java.lang.Object
com.arranger.jarl.util.XMLUtil
- public class XMLUtil
- extends java.lang.Object
XMLUtil created on Jan 18, 2003
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAXP_SCHEMA_LANGUAGE
public static final java.lang.String JAXP_SCHEMA_LANGUAGE
- See Also:
- Constant Field Values
W3C_XML_SCHEMA
public static final java.lang.String W3C_XML_SCHEMA
- See Also:
- Constant Field Values
s_docBuilderFactory
protected static javax.xml.parsers.DocumentBuilderFactory s_docBuilderFactory
s_useValidation
protected static boolean s_useValidation
XMLUtil
public XMLUtil()
getDocBuilderFactory
public static javax.xml.parsers.DocumentBuilderFactory getDocBuilderFactory()
setDocBuilderFactory
public static void setDocBuilderFactory(javax.xml.parsers.DocumentBuilderFactory docBuilderFactory)
isUseValidation
public static boolean isUseValidation()
setUseValidation
public static void setUseValidation(boolean useValidation)
loadDocument
public static org.w3c.dom.Document loadDocument(java.lang.String location)
throws java.lang.Exception
loadDocument
public static org.w3c.dom.Document loadDocument(java.lang.String location,
boolean doInclude)
throws java.lang.Exception
selectSingleNode
public static org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node node,
java.lang.String xpath)
- returns a node from the suplied node that meets the xpath criteria.
selectElement
public static org.w3c.dom.Element selectElement(org.w3c.dom.Node node,
java.lang.String xpath)
- returns a node from the suplied node that meets the xpath criteria.
selectNodeList
public static org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node node,
java.lang.String xpath)
- returns a node list from the suplied node that meets the xpath criteria.
selectNodeIterator
public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(org.w3c.dom.Node node,
java.lang.String xpath)
- returns a node iterator from the suplied node that meets the xpath criteria.
loadDocument
public static org.w3c.dom.Document loadDocument(java.io.InputStream inputStream)
throws java.lang.Exception
loadDocument
public static org.w3c.dom.Document loadDocument(java.io.Reader reader)
throws java.lang.Exception
loadDocumentFromXML
public static org.w3c.dom.Document loadDocumentFromXML(java.lang.String xml)
throws java.lang.Exception
newDocument
public static org.w3c.dom.Document newDocument()
newDocumentBuilder
public static javax.xml.parsers.DocumentBuilder newDocumentBuilder()
- Creates and returns document builder
getBuilderFactory
public static javax.xml.parsers.DocumentBuilderFactory getBuilderFactory()
throws java.lang.Exception
getNodeText
public static java.lang.String getNodeText(org.w3c.dom.Node node)
- Get the text value for the given node.
_loadDocument
protected static org.w3c.dom.Document _loadDocument(org.xml.sax.InputSource inputSource)
throws java.lang.Exception
toString
public static java.lang.String toString(org.w3c.dom.Node node)
- Serializes document node and returns its content as a string
toString
public static java.lang.String toString(org.w3c.dom.Node node,
boolean minimizeXMLSize)
- Serializes document node and returns its content as a string
getXMLSerializer
private static org.apache.xml.serialize.XMLSerializer getXMLSerializer(java.io.Writer out,
boolean minimizeXMLSize)
preprocesXML
public static java.lang.String preprocesXML(java.io.File file,
java.util.Stack stack)
throws java.lang.Exception
replaceText
protected static java.lang.String replaceText(java.lang.String includeDirective,
java.util.Stack stack)
throws java.lang.Exception