|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.xml.XML
public class XML
Contains utility methods for working with XML structures.
Constructor Summary | |
---|---|
XML()
|
Method Summary | |
---|---|
static Element |
getElement(Element root,
String path)
Returns the element matching a given path. |
static List<Element> |
getElements(Element root,
String path,
String name)
Returns the sub-elements of a descendant of root whose tag names
match the given name. |
static String |
getText(Element root,
String path)
Returns the text content of a descendant of root . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XML()
Method Detail |
---|
public static Element getElement(Element root, String path)
root
- The element from which to begin the search.path
- A path of the form:
tag[n]/tag[n]/...The bracketed index values are optional and refer to the nth occurrence of the given tag name within its parent element. If omitted, the path refers to the first occurrence of the named element (i.e. the element at index 0).
null
if no such element exists.public static List<Element> getElements(Element root, String path, String name)
root
whose tag names
match the given name.
root
- The element from which to begin the search.path
- The path to the descendant, relative to root
.name
- The tag name to match.
null
if no such descendant exists.getElement(Element, String)
,
Element.getElements(String)
public static String getText(Element root, String path)
root
.
root
- The element from which to begin the search.path
- The path to the descendant, relative to root
.
null
if no such descendant
exists.getElement(Element, String)
,
Element.getText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |