Package com.bc.ceres.metadata
Class XPathHandler
java.lang.Object
com.bc.ceres.metadata.XPathHandler
Handles XPath expressions in velocity template files. The expressions parse an input xml file.
- Since:
- Ceres 0.13.2
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
XPathHandler
public XPathHandler()
-
-
Method Details
-
run
Run a XPath query. Call with $xpath.run("XPath expression", $source-XML) in the velocity template. e.g. $xpath.run("//creationDate", $metadata)- Parameters:
xpath
- The XPath expressiondocument
- Either an instance ofReaderResource
,Element
or a raw xmlString
.- Returns:
- The demanded information from the XML document.
-
extractXml
Run a XPath query. Call with $xpath.run("XPath expression", $source-XML) in the velocity template. e.g. $xpath.run("//creationDate", $metadata)- Parameters:
xpath
- The XPath expressiondocument
- Either an instance ofReaderResource
,Element
or a raw xmlString
.- Returns:
- The whole XML snippet, which starts with the tag selected in the xpath expression.
- Throws:
XPathExpressionException
-