|
ArcGIS Server Geoportal extension 10
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.gpt.framework.xml.DomUtil
public class DomUtil
XML Document utility functions.
Method Summary | |
---|---|
static String |
documentToXml(Document doc)
Deprecated. as of 9.3.1. Use XmlIoUtil.domToString(Document) |
static Node[] |
findChildren(Node parent,
String childTagName)
Finds the children of a parent node matching the supplied child tag name. |
static Node |
findFirst(Node parent,
String childTagName)
Finds the first child of a parent node based upon the supplied tag name for the child. |
static String |
getAttributeValue(NamedNodeMap nnm,
String name)
Returns an attribute value from a NamedNodeMap. |
static String |
getTextContent(Node parentNode)
Returns the text node content associated with a parent node. |
static Document |
makeDomFromResourcePath(String path,
boolean namespaceAware)
Makes an XML document associated with a specified resource. |
static Document |
makeDomFromSource(InputSource src,
boolean namespaceAware)
Makes an XML document based upon an input source. |
static Document |
makeDomFromString(String xml,
boolean namespaceAware)
Makes an XML document from an XML string. |
static Document |
newDocument()
Creates an empty XML document. |
static String |
toXml(Node node)
Deprecated. since 10.0. Recomended option for turning a single node into the complete string is the following sequence of the code: Document mdDoc = DomUtil.newDocument(); mdDoc.appendChild(mdDoc.importNode(node, true)); String mdText = XmlIoUtil.domToString(mdDoc); |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String getAttributeValue(NamedNodeMap nnm, String name)
nnm
- the NamedNodeMap of attributesname
- the name of the attribute to retrieve
public static String getTextContent(Node parentNode)
parentNode
- the parent node for which text will be extracted
public static Node[] findChildren(Node parent, String childTagName)
parent
- the parent containing the children to findchildTagName
- the tag name of the child to find
public static Node findFirst(Node parent, String childTagName)
parent
- the parent of the child node to findchildTagName
- the tag name for the node to find
public static Document makeDomFromResourcePath(String path, boolean namespaceAware) throws ParserConfigurationException, SAXException, IOException
path
- the path for the resource (relative to WEB-INF/classes)namespaceAware
- true if the Document should be namespace aware.
ParserConfigurationException
- if a configuration exception occurs
SAXException
- if an exception occurs during XML parsing
IOException
- if an i/o exception occurspublic static Document makeDomFromSource(InputSource src, boolean namespaceAware) throws ParserConfigurationException, SAXException, IOException
src
- the InputSourcenamespaceAware
- true if the Document should be namespace aware
ParserConfigurationException
- if a configuration exception occurs
SAXException
- if an exception occurs during XML parsing
IOException
- if an i/o exception occurspublic static Document makeDomFromString(String xml, boolean namespaceAware) throws ParserConfigurationException, SAXException, IOException
xml
- the xml stringnamespaceAware
- true if the Document should be namespace aware.
ParserConfigurationException
- if a configuration exception occurs
SAXException
- if an exception occurs during XML parsing
IOException
- if an i/o exception occurspublic static Document newDocument() throws ParserConfigurationException, SAXException, IOException
ParserConfigurationException
- if a configuration exception occurs
SAXException
- if an exception occurs during XML parsing
IOException
- if an i/o exception occurs@Deprecated public static String toXml(Node node)
Document mdDoc = DomUtil.newDocument(); mdDoc.appendChild(mdDoc.importNode(node, true)); String mdText = XmlIoUtil.domToString(mdDoc);
node
- node to xmlize
@Deprecated public static String documentToXml(Document doc)
XmlIoUtil.domToString(Document)
doc
- document to xmlize
|
ArcGIS Server Geoportal extension 10
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |