org.apache.lenya.xml
Class XPath

java.lang.Object
  extended by org.apache.lenya.xml.XPath

public class XPath
extends java.lang.Object

Helper class for XPath operations


Constructor Summary
XPath(java.lang.String _xpath)
          Constructor
 
Method Summary
 java.lang.String getElementName()
          Return the name of the element
 java.lang.String getName()
          Get the name
 java.lang.String getNameWithoutPredicates()
          Get the name without predicates
 XPath getParent()
          Get the parent path
 short getType()
          Get the type of a node.
 java.lang.String removePredicates(java.lang.String s)
          Remove predicates (square brackets), http://www.w3.org/TR/xpath
 java.lang.String toString()
          Return a string representation of the XPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XPath

public XPath(java.lang.String _xpath)
Constructor

Parameters:
_xpath - The Xpath
Method Detail

getParent

public XPath getParent()
Get the parent path

Returns:
The parent path

getType

public short getType()
Get the type of a node. Only supports attribute and element nodes

Returns:
The node type

toString

public java.lang.String toString()
Return a string representation of the XPath

Overrides:
toString in class java.lang.Object
Returns:
The Xpath

getName

public java.lang.String getName()
Get the name

Returns:
The name

getElementName

public java.lang.String getElementName()
Return the name of the element

Returns:
the name of the element

getNameWithoutPredicates

public java.lang.String getNameWithoutPredicates()
Get the name without predicates

Returns:
The name without predicates

removePredicates

public java.lang.String removePredicates(java.lang.String s)
Remove predicates (square brackets), http://www.w3.org/TR/xpath

Parameters:
s - The string to remove predicates from
Returns:
The string without predicates


Copyright © 1999-2006 Apache Software Foundation. All Rights Reserved.