org.jscience.ml.gml.xml.util
Class XMLUtils

java.lang.Object
  extended by org.jscience.ml.gml.xml.util.XMLUtils

public class XMLUtils
extends java.lang.Object

Provides some utility methods.


Constructor Summary
XMLUtils()
           
 
Method Summary
static java.util.List executeXPathQuery(org.jdom.Element parent, java.lang.String path)
          Executes an XPath query using namespaces.
static java.util.List getGlobalElementsWithAttribute(org.jdom.Element root, java.lang.String elemName, org.jdom.Namespace elemNamespace, java.lang.String attrName, java.lang.String attrValue)
          Finds global elements with the given attribute value.
static org.jdom.Document string2jdom(java.lang.String sourceString)
          Converts XML text to a JDOM document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

string2jdom

public static org.jdom.Document string2jdom(java.lang.String sourceString)
Converts XML text to a JDOM document.

Parameters:
sourceString - DOCUMENT ME!
Returns:
Null if the conversion fails.

executeXPathQuery

public static java.util.List executeXPathQuery(org.jdom.Element parent,
                                               java.lang.String path)
                                        throws org.jaxen.saxpath.SAXPathException
Executes an XPath query using namespaces.

Parameters:
parent - The query context.
path - The XPath query.
Returns:
Returns a list of XML nodes matching the query. java.util.Collections.EMPTY_LIST is returned if no match was found.
Throws:
org.jaxen.saxpath.SAXPathException - DOCUMENT ME!

getGlobalElementsWithAttribute

public static java.util.List getGlobalElementsWithAttribute(org.jdom.Element root,
                                                            java.lang.String elemName,
                                                            org.jdom.Namespace elemNamespace,
                                                            java.lang.String attrName,
                                                            java.lang.String attrValue)
Finds global elements with the given attribute value.

Parameters:
root - DOCUMENT ME!
elemName - DOCUMENT ME!
elemNamespace - DOCUMENT ME!
attrName - DOCUMENT ME!
attrValue - DOCUMENT ME!
Returns:
List of global elements. Empty list if none found.