public class XMLExtractor
extends java.lang.Object
Constructor and Description |
---|
XMLExtractor()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
getAttributeValuesFromDoc(java.lang.String expression)
Gets the values of the given expression.
|
java.util.List<java.lang.String> |
getAttributeValuesFromItem(java.lang.String expression,
java.lang.Object item)
Gets the values of the given expression.
|
static java.lang.String |
getDefaultNamespace()
Get the default namespace URI.
|
net.sf.saxon.om.DocumentInfo |
getDocNode()
Gets the document node of the XML document.
|
net.sf.saxon.tree.tiny.TinyElementImpl |
getNodeFromDoc(java.lang.String expression)
Gets a Node object from the given expression.
|
net.sf.saxon.tree.tiny.TinyElementImpl |
getNodeFromItem(java.lang.String expression,
java.lang.Object item)
Gets a Node object from the given expression.
|
java.util.List<net.sf.saxon.tree.tiny.TinyElementImpl> |
getNodesFromDoc(java.lang.String expression)
Gets Node objects from the given expression.
|
java.util.List<net.sf.saxon.tree.tiny.TinyElementImpl> |
getNodesFromItem(java.lang.String expression,
java.lang.Object item)
Gets Node objects from the given expression.
|
java.lang.String |
getValueFromDoc(java.lang.String expression)
Gets the value of the given expression.
|
java.lang.String |
getValueFromItem(java.lang.String expression,
java.lang.Object item)
Gets the value of the given expression.
|
java.util.List<java.lang.String> |
getValuesFromDoc(java.lang.String expression)
Gets the values of the given expression.
|
java.util.List<java.lang.String> |
getValuesFromItem(java.lang.String expression,
java.lang.Object item)
Gets the values of the given expression.
|
void |
parse(java.io.File src)
Parse the given file.
|
void |
parse(java.lang.String src)
Parse the given file.
|
static void |
setDefaultNamespace(java.lang.String uri)
Sets the default namespace URI.
|
static void |
setNamespaceContext(PDSNamespaceContext context)
Sets the Namespace Context to support handling of namespaces
in XML documents.
|
public void parse(java.io.File src) throws net.sf.saxon.trans.XPathException
src
- An XML file.net.sf.saxon.trans.XPathException
- If an error occurred while parsing the XML file.public void parse(java.lang.String src) throws net.sf.saxon.trans.XPathException
src
- An XML file.net.sf.saxon.trans.XPathException
- If an error occurred while parsing the XML file.public static void setDefaultNamespace(java.lang.String uri)
uri
- A URI.public static java.lang.String getDefaultNamespace()
public static void setNamespaceContext(PDSNamespaceContext context)
context
- The NamespaceContext object.public java.lang.String getValueFromDoc(java.lang.String expression) throws javax.xml.xpath.XPathExpressionException, net.sf.saxon.trans.XPathException
expression
- An XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.net.sf.saxon.trans.XPathException
public java.lang.String getValueFromItem(java.lang.String expression, java.lang.Object item) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the
XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public net.sf.saxon.tree.tiny.TinyElementImpl getNodeFromDoc(java.lang.String expression) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public net.sf.saxon.tree.tiny.TinyElementImpl getNodeFromItem(java.lang.String expression, java.lang.Object item) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the
XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public java.util.List<java.lang.String> getValuesFromDoc(java.lang.String expression) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public java.util.List<java.lang.String> getValuesFromItem(java.lang.String expression, java.lang.Object item) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the
XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public net.sf.saxon.om.DocumentInfo getDocNode() throws net.sf.saxon.trans.XPathException
net.sf.saxon.trans.XPathException
public java.util.List<net.sf.saxon.tree.tiny.TinyElementImpl> getNodesFromDoc(java.lang.String expression) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public java.util.List<net.sf.saxon.tree.tiny.TinyElementImpl> getNodesFromItem(java.lang.String expression, java.lang.Object item) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the
XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public java.util.List<java.lang.String> getAttributeValuesFromDoc(java.lang.String expression) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.public java.util.List<java.lang.String> getAttributeValuesFromItem(java.lang.String expression, java.lang.Object item) throws javax.xml.xpath.XPathExpressionException
expression
- An XPath expression.item
- The starting point from which to evaluate the
XPath expression.javax.xml.xpath.XPathExpressionException
- If the given expression was malformed.Copyright © 2010-2018 Planetary Data System. All Rights Reserved.