public class XMLXPathParser
extends java.lang.Object
| Constructor and Description |
|---|
XMLXPathParser() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getAttribute(java.lang.String path)
Get the attribute name if there is one.
|
static java.lang.String |
getPath(java.lang.String path)
Get the element path.
|
public static java.lang.String getPath(java.lang.String path)
Example 1
xml = <root><row index="1" data="This is the data"/></root>
xpath = root/row[@data]
path = root/row
attribute = data
Example 2
xml = <root><row index="1" data="This is the data"/></root>
xpath = root/row
path = root/row
attribute = null
path - public static java.lang.String getAttribute(java.lang.String path)
Example 1
xml = <root><row index="1" data="This is the data"/></root>
xpath = root/row[@data]
path = root/row
attribute = data
Example 2
xml = <root><row index="1" data="This is the data"/></root>
xpath = root/row
path = root/row
attribute = null
path -