public class XMLExtractor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_NAMESPACE |
static String |
SCHEMA_LOCATION_XPATH |
static String |
TARGET_NAMESPACE |
static String |
XML_MODEL_XPATH |
Constructor and Description |
---|
XMLExtractor(File file) |
XMLExtractor(InputSource source) |
XMLExtractor(Source xml)
Constructor.
|
XMLExtractor(String url)
Constructor.
|
XMLExtractor(URL url)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultNamespace() |
Source |
getDocNode()
Gets the document node of the XML document.
|
net.sf.saxon.tree.tiny.TinyNodeImpl |
getNodeFromDoc(String expression)
Gets a Node object from the given expression.
|
net.sf.saxon.tree.tiny.TinyNodeImpl |
getNodeFromItem(String expression,
Object item)
Gets a Node object from the given expression.
|
List<net.sf.saxon.tree.tiny.TinyNodeImpl> |
getNodesFromDoc(String expression)
Gets Node objects from the given expression.
|
List<net.sf.saxon.tree.tiny.TinyNodeImpl> |
getNodesFromItem(String expression,
Object item)
Gets Node objects from the given expression.
|
String |
getSchemaLocation() |
String |
getSystemId() |
String |
getTargetNamespace() |
String |
getValueFromDoc(String expression)
Gets the value of the given expression.
|
String |
getValueFromItem(String expression,
Object item)
Gets the value of the given expression.
|
List<String> |
getValuesFromDoc(String expression)
Gets the values of the given expression.
|
List<String> |
getValuesFromItem(String expression,
Object item)
Gets the values of the given expression.
|
List<String> |
getXmlModels() |
public static final String SCHEMA_LOCATION_XPATH
public static final String XML_MODEL_XPATH
public static final String DEFAULT_NAMESPACE
public static final String TARGET_NAMESPACE
public XMLExtractor(Source xml) throws XPathExpressionException, net.sf.saxon.trans.XPathException
xml
- A parsed XML document.net.sf.saxon.trans.XPathException
- If an error occurred while parsing the given xml file.XPathExpressionException
- If an error occurred while setting up the default namespace.public XMLExtractor(URL url) throws net.sf.saxon.trans.XPathException, XPathExpressionException
xmlFile
- An xml file.net.sf.saxon.trans.XPathException
- If an error occurred while parsing the given xml file.XPathExpressionException
- If an error occurred while setting up the default namespace.public XMLExtractor(InputSource source) throws net.sf.saxon.trans.XPathException, XPathExpressionException
net.sf.saxon.trans.XPathException
XPathExpressionException
public XMLExtractor(File file) throws net.sf.saxon.trans.XPathException, XPathExpressionException, MalformedURLException
net.sf.saxon.trans.XPathException
XPathExpressionException
MalformedURLException
public XMLExtractor(String url) throws net.sf.saxon.trans.XPathException, XPathExpressionException, MalformedURLException
xmlFile
- An xml file.net.sf.saxon.trans.XPathException
- If an error occurred while parsing the given xml file.XPathExpressionException
- If an error occurred while setting up the default namespace.MalformedURLException
public String getValueFromDoc(String expression) throws XPathExpressionException, net.sf.saxon.trans.XPathException
expression
- An XPath expression.XPathExpressionException
- If the given expression was malformed.net.sf.saxon.trans.XPathException
public String getValueFromItem(String expression, Object item) throws XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the XPath expression.XPathExpressionException
- If the given expression was malformed.public net.sf.saxon.tree.tiny.TinyNodeImpl getNodeFromDoc(String expression) throws XPathExpressionException, net.sf.saxon.trans.XPathException
expression
- An XPath expression.XPathExpressionException
- If the given expression was malformed.net.sf.saxon.trans.XPathException
public net.sf.saxon.tree.tiny.TinyNodeImpl getNodeFromItem(String expression, Object item) throws XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the XPath expression.XPathExpressionException
- If the given expression was malformed.public List<String> getValuesFromDoc(String expression) throws XPathExpressionException, net.sf.saxon.trans.XPathException
expression
- An XPath expression.XPathExpressionException
- If the given expression was malformed.net.sf.saxon.trans.XPathException
public List<String> getValuesFromItem(String expression, Object item) throws XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the XPath expression.XPathExpressionException
- If the given expression was malformed.public Source getDocNode() throws net.sf.saxon.trans.XPathException
net.sf.saxon.trans.XPathException
public List<net.sf.saxon.tree.tiny.TinyNodeImpl> getNodesFromDoc(String expression) throws XPathExpressionException, net.sf.saxon.trans.XPathException
expression
- An XPath expression.XPathExpressionException
- If the given expression was malformed.net.sf.saxon.trans.XPathException
public List<net.sf.saxon.tree.tiny.TinyNodeImpl> getNodesFromItem(String expression, Object item) throws XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the XPath expression.XPathExpressionException
- If the given expression was malformed.public String getSchemaLocation() throws XPathExpressionException, net.sf.saxon.trans.XPathException
XPathExpressionException
net.sf.saxon.trans.XPathException
public List<String> getXmlModels() throws XPathExpressionException, net.sf.saxon.trans.XPathException
XPathExpressionException
net.sf.saxon.trans.XPathException
public String getDefaultNamespace() throws XPathExpressionException, net.sf.saxon.trans.XPathException
XPathExpressionException
net.sf.saxon.trans.XPathException
public String getTargetNamespace() throws XPathExpressionException, net.sf.saxon.trans.XPathException
XPathExpressionException
net.sf.saxon.trans.XPathException
public String getSystemId()
Copyright © 2022 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved.