Package com.bc.ceres.metadata
Class XPathHandler
- java.lang.Object
- 
- com.bc.ceres.metadata.XPathHandler
 
- 
 public class XPathHandler extends Object Handles XPath expressions in velocity template files. The expressions parse an input xml file.- Since:
- Ceres 0.13.2
 
- 
- 
Constructor SummaryConstructors Constructor Description XPathHandler()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringextractXml(String xpath, Object document)Run a XPath query.Stringrun(String xpath, Object document)Run a XPath query.
 
- 
- 
- 
Method Detail- 
runpublic String run(String xpath, Object document) 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 expression
- document- Either an instance of- ReaderResource,- Elementor a raw xml- String.
- Returns:
- The demanded information from the XML document.
 
 - 
extractXmlpublic String extractXml(String xpath, Object document) throws XPathExpressionException 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 expression
- document- Either an instance of- ReaderResource,- Elementor a raw xml- String.
- Returns:
- The whole XML snippet, which starts with the tag selected in the xpath expression.
- Throws:
- XPathExpressionException
 
 
- 
 
-