|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mls.common.XmlObject
Methods to parse and access XML documents
Field Summary | |
protected static java.lang.String[] |
INDENT
Used in XML string creation and printing |
Constructor Summary | |
XmlObject()
|
Method Summary | |
static java.lang.String |
dump(org.w3c.dom.Document xml)
Dump the specified XML document to a string |
private static java.lang.String |
dumpElement(org.w3c.dom.Element el,
int indent)
Dump a single element at the specified indent level |
private static java.util.Vector |
getChildren(org.w3c.dom.Document parent,
java.lang.String elTagName)
Return child elements of a document with specified tag name |
private static java.util.Vector |
getChildren(org.w3c.dom.Element parent,
java.lang.String elTagName)
Return child elements of an element with specified tag name |
protected static org.w3c.dom.Element |
getElement(org.w3c.dom.Document doc,
java.lang.String elTagName)
Return the first element matching the elTagName in a document |
protected static org.w3c.dom.Element |
getElement(org.w3c.dom.Element parent,
java.lang.String elTagName)
Return the first element matching the elTagName in an element |
protected static org.w3c.dom.Element |
getElement(org.w3c.dom.Element parent,
java.lang.String elTagName,
int n)
Return the nth element matching the elTagName in an element |
protected static java.lang.String |
getElementText(org.w3c.dom.Element el)
Return the specified element's text |
private static org.apache.xerces.parsers.DOMParser |
getParser()
Common routine to get a DOM parser |
protected static java.lang.String |
indent(int level)
Return an indentation string based on level |
private static java.util.Vector |
narrow(org.w3c.dom.NodeList descendents,
org.w3c.dom.Node parent)
Narrow descendents node list to the child elements |
protected static int |
nElements(org.w3c.dom.Element element,
java.lang.String elTagName)
Return a count of all elements under element matching the tag |
protected static org.w3c.dom.Document |
parse(java.lang.String fileName)
Create a DOM document structure from the specified XML file |
protected static org.w3c.dom.Document |
parseString(java.lang.String s)
Create a DOM document structure from the specified XML string |
Methods inherited from class java.lang.Object |
|
Field Detail |
protected static final java.lang.String[] INDENT
Constructor Detail |
public XmlObject()
Method Detail |
protected static java.lang.String indent(int level)
level
- the level of indentationprotected static org.w3c.dom.Document parseString(java.lang.String s)
s
- The string containing XML documentprotected static org.w3c.dom.Document parse(java.lang.String fileName)
fileName
- The name of the XML documentprivate static org.apache.xerces.parsers.DOMParser getParser() throws org.xml.sax.SAXNotSupportedException, org.xml.sax.SAXNotRecognizedException
protected static org.w3c.dom.Element getElement(org.w3c.dom.Element parent, java.lang.String elTagName)
parent
- the parent element to search underelTagName
- the element tag to look forprotected static org.w3c.dom.Element getElement(org.w3c.dom.Document doc, java.lang.String elTagName)
doc
- the DOM document to searchelTagName
- the element tag to look forprotected static org.w3c.dom.Element getElement(org.w3c.dom.Element parent, java.lang.String elTagName, int n)
parent
- the parent element to search underelTagName
- the element tag to look forn
- the number of the element to returnprotected static int nElements(org.w3c.dom.Element element, java.lang.String elTagName)
element
- the parent element to search underelTagName
- the element tag to look forprivate static java.util.Vector getChildren(org.w3c.dom.Element parent, java.lang.String elTagName)
parent
- the parent element to search underelTagName
- the element tag to look forprivate static java.util.Vector getChildren(org.w3c.dom.Document parent, java.lang.String elTagName)
parent
- the parent document to search underelTagName
- the element tag to look forprivate static java.util.Vector narrow(org.w3c.dom.NodeList descendents, org.w3c.dom.Node parent)
descendents
- the descdendent list to narrowparent
- the parent node to match onprotected static java.lang.String getElementText(org.w3c.dom.Element el)
element
- the element to examinepublic static java.lang.String dump(org.w3c.dom.Document xml)
xml
- the document to dumpprivate static java.lang.String dumpElement(org.w3c.dom.Element el, int indent)
el
- the element to dumpindent
- the indentation level of this element
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |