public final class XmlSaxTableDef extends Object implements Serializable
XmlSaxDataContext
. This class is used as
an instruction set of xpath expressions for the datacontext to create
Table
s.
These types of expressions are allowed in the XmlSaxTableDef
:
<root> <organization type="company"> <name>Company A</name> <employees> <employee> <name>John Doe</name> <gender>M</gender> </employee> <employee> <name>Jane Doe</name> <gender>F</gender> </employee> </employees> </organization> <organization type="government"> <name>Company B</name> <employees> <employee> <name>Susan</name> <gender>F</gender> </employee> </employees> </organization> </root>Then if you wanted to extract information about organizations, these xpaths could work:
Constructor and Description |
---|
XmlSaxTableDef(String rowXpath,
String[] valueXpaths)
Constructs a
XmlSaxTableDef based on an xpath expression for the
row scope and an array of xpath expressions for the individual values
(columns) within a row. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getRowXpath() |
String[] |
getValueXpaths() |
int |
hashCode() |
String |
toString() |
public XmlSaxTableDef(String rowXpath, String[] valueXpaths)
XmlSaxTableDef
based on an xpath expression for the
row scope and an array of xpath expressions for the individual values
(columns) within a row.rowXpath
- an xpath expression for the scope of a record, eg.
/companies/company/employeevalueXpaths
- an array of xpath expressions for the individual values
(columns) of a row. eg: [/companies/company/employee/name,
/companies/company/employee/gender, index(/companies/company)]Copyright © 2007–2017 The Apache Software Foundation. All rights reserved.