org.jsxp.framework.dom
Class XMLProcessing

java.lang.Object
  extended by org.jsxp.framework.dom.XMLProcessing
Direct Known Subclasses:
ViewParserDom

public class XMLProcessing
extends java.lang.Object

The Class XMLProcessing. Used by the ViewParserDom implementation to process a xml file.


Constructor Summary
XMLProcessing()
          Instantiates a new xML processing.
 
Method Summary
protected static org.w3c.dom.Node getNode(org.w3c.dom.Node node, java.lang.String expression)
          Gets the node.
protected static org.w3c.dom.NodeList getNodes(org.w3c.dom.Document document, java.lang.String expression)
          Gets the nodes.
protected static org.w3c.dom.Document parseDocument(java.io.InputStream inputStream)
          Parses the document.
protected static void printFile(java.lang.String filename)
          Prints the file.
static void validate(org.w3c.dom.Document document)
          Validate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLProcessing

public XMLProcessing()
Instantiates a new xML processing.

Method Detail

getNode

protected static org.w3c.dom.Node getNode(org.w3c.dom.Node node,
                                          java.lang.String expression)
                                   throws javax.xml.xpath.XPathExpressionException
Gets the node.

Parameters:
node - the node
expression - the expression
Returns:
the node
Throws:
javax.xml.xpath.XPathExpressionException - the x path expression exception

getNodes

protected static org.w3c.dom.NodeList getNodes(org.w3c.dom.Document document,
                                               java.lang.String expression)
                                        throws javax.xml.xpath.XPathExpressionException
Gets the nodes.

Parameters:
document - the document
expression - the expression
Returns:
the nodes
Throws:
javax.xml.xpath.XPathExpressionException - the x path expression exception

parseDocument

protected static org.w3c.dom.Document parseDocument(java.io.InputStream inputStream)
                                             throws javax.xml.parsers.ParserConfigurationException,
                                                    org.xml.sax.SAXException,
                                                    java.io.IOException
Parses the document.

Parameters:
inputStream - the input stream
Returns:
the document
Throws:
javax.xml.parsers.ParserConfigurationException - the parser configuration exception
org.xml.sax.SAXException - the SAX exception
java.io.IOException - Signals that an I/O exception has occurred.

printFile

protected static void printFile(java.lang.String filename)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
Prints the file.

Parameters:
filename - the filename
Throws:
java.io.FileNotFoundException - the file not found exception
java.io.IOException - Signals that an I/O exception has occurred.

validate

public static void validate(org.w3c.dom.Document document)
                     throws java.net.MalformedURLException,
                            org.xml.sax.SAXException,
                            java.io.IOException
Validate.

Parameters:
document - the document
Throws:
java.net.MalformedURLException - the malformed url exception
org.xml.sax.SAXException - the SAX exception
java.io.IOException - Signals that an I/O exception has occurred.


Copyright © 2012 Oliver Szymanski & David Tanzer