gov.nasa.pds.harvest.util
Class XMLExtractor

java.lang.Object
  extended by gov.nasa.pds.harvest.util.XMLExtractor

public class XMLExtractor
extends Object

Author:
pramirez

Constructor Summary
XMLExtractor()
           
XMLExtractor(File src)
           
XMLExtractor(String src)
           
 
Method Summary
 Node getDocNode()
           
 Node getNodeFromDoc(String expression)
           
 Node getNodeFromItem(String expression, Object item)
           
 NodeList getNodesFromDoc(String expression)
           
 NodeList getNodesFromItem(String expression, Object item)
           
 String getValue(String expression, String xmlStr)
           
 String getValueFromDoc(String expression)
           
 String getValueFromItem(String expression, Object item)
           
 List<String> getValuesFromDoc(String expression)
           
 List<String> getValuesFromItem(String expression, Object item)
           
static void main(String[] args)
           
 void setDefaultNamespace(String uri)
           
 void setNamespaceContext(NamespaceContext context)
           
 void validate(String schema)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLExtractor

public XMLExtractor()
             throws ParserConfigurationException,
                    XPathFactoryConfigurationException
Throws:
ParserConfigurationException
XPathFactoryConfigurationException

XMLExtractor

public XMLExtractor(File src)
             throws ParserConfigurationException,
                    XPathFactoryConfigurationException,
                    SAXException,
                    IOException
Throws:
ParserConfigurationException
XPathFactoryConfigurationException
SAXException
IOException

XMLExtractor

public XMLExtractor(String src)
             throws ParserConfigurationException,
                    SAXException,
                    IOException,
                    XPathFactoryConfigurationException
Throws:
ParserConfigurationException
SAXException
IOException
XPathFactoryConfigurationException
Method Detail

setDefaultNamespace

public void setDefaultNamespace(String uri)

setNamespaceContext

public void setNamespaceContext(NamespaceContext context)

validate

public void validate(String schema)
              throws SAXException,
                     IOException
Throws:
SAXException
IOException

getValueFromDoc

public String getValueFromDoc(String expression)
                       throws XPathExpressionException
Throws:
XPathExpressionException

getValueFromItem

public String getValueFromItem(String expression,
                               Object item)
                        throws XPathExpressionException
Throws:
XPathExpressionException

getNodeFromDoc

public Node getNodeFromDoc(String expression)
                    throws XPathExpressionException
Throws:
XPathExpressionException

getNodeFromItem

public Node getNodeFromItem(String expression,
                            Object item)
                     throws XPathExpressionException
Throws:
XPathExpressionException

getValuesFromDoc

public List<String> getValuesFromDoc(String expression)
                              throws XPathExpressionException
Throws:
XPathExpressionException

getValuesFromItem

public List<String> getValuesFromItem(String expression,
                                      Object item)
                               throws XPathExpressionException
Throws:
XPathExpressionException

getDocNode

public Node getDocNode()

getNodesFromDoc

public NodeList getNodesFromDoc(String expression)
                         throws XPathExpressionException
Throws:
XPathExpressionException

getNodesFromItem

public NodeList getNodesFromItem(String expression,
                                 Object item)
                          throws XPathExpressionException
Throws:
XPathExpressionException

getValue

public String getValue(String expression,
                       String xmlStr)
                throws XPathExpressionException,
                       SAXException,
                       IOException
Throws:
XPathExpressionException
SAXException
IOException

main

public static void main(String[] args)


Copyright © 2005-2010 Planetary Data System. All Rights Reserved.