electric.xml.xpath
Class TMEXPath

java.lang.Object
  extended byelectric.xml.xpath.TMEXPath
All Implemented Interfaces:
IXPath

public class TMEXPath
extends java.lang.Object
implements IXPath

TMEXPath

Author:
webMethods

Constructor Summary
TMEXPath(java.lang.String xpath)
          Construct an XPath with the specified expression and no namespace context.
TMEXPath(java.lang.String xpath, INamespaceContext namespaceContext)
          Construct an XPath with the specified expression and namespace context.
 
Method Summary
 Attribute getAttribute(Element element)
           
 Attributes getAttributes(Element element)
           
 boolean getBoolean(Node node)
           
 Element getElement(Parent parent)
           
 Elements getElements(Parent parent)
           
 java.lang.String getNamespace(java.lang.String prefix)
          Return the namespace associated with the specified prefix, or null if none exists.
 INamespaceContext getNamespaceContext()
          Return the namespace context.
 Node getNode(Node node)
           
 Nodes getNodes(Node node)
           
 void setNamespace(java.lang.String prefix, java.lang.String namespace)
          Register a namespace with the specified prefix and namespace.
 void setNamespaceContext(INamespaceContext namespaceContext)
          Set the namespace context.
 java.lang.String toString()
          Return the xpath expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TMEXPath

public TMEXPath(java.lang.String xpath)
         throws XPathException
Construct an XPath with the specified expression and no namespace context.

Parameters:
xpath - The xpath expression.
Throws:
XPathException - If the path is malformed.

TMEXPath

public TMEXPath(java.lang.String xpath,
                INamespaceContext namespaceContext)
         throws XPathException
Construct an XPath with the specified expression and namespace context.

Parameters:
xpath - The xpath expression.
namespaceContext - The namespace context.
Throws:
XPathException - If the path is malformed.
Method Detail

toString

public java.lang.String toString()
Return the xpath expression.


getNamespaceContext

public INamespaceContext getNamespaceContext()
Return the namespace context.


setNamespaceContext

public void setNamespaceContext(INamespaceContext namespaceContext)
Set the namespace context.

Parameters:
namespaceContext - The new value.

getNodes

public Nodes getNodes(Node node)
               throws XPathException
Specified by:
getNodes in interface IXPath
Parameters:
node -
Throws:
XPathException

getNode

public Node getNode(Node node)
             throws XPathException
Specified by:
getNode in interface IXPath
Parameters:
node -
Throws:
XPathException

getAttribute

public Attribute getAttribute(Element element)
                       throws XPathException
Specified by:
getAttribute in interface IXPath
Parameters:
element -
Throws:
XPathException

getAttributes

public Attributes getAttributes(Element element)
                         throws XPathException
Specified by:
getAttributes in interface IXPath
Parameters:
element -
Throws:
XPathException

getElement

public Element getElement(Parent parent)
                   throws XPathException
Specified by:
getElement in interface IXPath
Parameters:
parent -
Throws:
XPathException

getElements

public Elements getElements(Parent parent)
                     throws XPathException
Specified by:
getElements in interface IXPath
Parameters:
parent -
Throws:
XPathException

setNamespace

public void setNamespace(java.lang.String prefix,
                         java.lang.String namespace)
Register a namespace with the specified prefix and namespace. If I don't already have a namespace context, set it to a HashtableNamespaceContext, which uses a Hashtable to record the mappings.

Specified by:
setNamespace in interface IXPath
Parameters:
prefix - The prefix.
namespace - The namespace.

getNamespace

public java.lang.String getNamespace(java.lang.String prefix)
Return the namespace associated with the specified prefix, or null if none exists.

Parameters:
prefix - The prefix.

getBoolean

public boolean getBoolean(Node node)
Specified by:
getBoolean in interface IXPath
Parameters:
node -


copyright© 2001-2004 by webMethods All Rights Reserved.