| 
DLESE Tools  v1.6.0  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dlese.dpc.xml.XPathUtils
public class XPathUtils
Utilities for testing and manipulating XPaths, represented as String.
| Constructor Summary | |
|---|---|
XPathUtils()
 | 
|
| Method Summary | |
|---|---|
static int | 
compare(String path1,
        String path2)
Compares two xpaths for "xpath order", using "natuiral" or alphabetical ordering except for when xpath indexing is involved, e.g., "/record/general[3]/foo[5]" is "less than" "/record/general[4]/foo[6]".  | 
static String | 
decodeXPath(String path)
Converts encoded paths of the form used in jsp pages ( "foo_1_") to a XPath form ("foo[1]").  | 
static String | 
encodeXPath(String s)
Converts indexed paths of the form ("foo[1]") to the form used in jsp pages ( "foo_1_")  | 
static int | 
getIndex(String s)
Returns the index, if any, for the leaf of the given path.  | 
static String | 
getLeaf(String xpath)
Returns the name of the element refered to by the given xpath, which is the leaf, stripped of "\@" in the case of attribute paths).  | 
static String | 
getNodeName(String xpath)
Returns the name of the node referred to by the (possibly jsp-encoded) xpath, stripped of indexing information.  | 
static String | 
getParentXPath(String xpath)
Gets the parentXPath attribute of the XPathUtils class  | 
static String | 
getSiblingXPath(String xpath)
Gets the siblingPath (that matches all like-named nodes of the parent Element) of a given xpath.  | 
static boolean | 
isAttributePath(String xpath)
Returns true if the xpath refers to an attribute.  | 
static String | 
normalizeXPath(String s)
Removes indexing information from XPath strings.  | 
static String | 
removeELbrackets(String s)
Remove jsp expressionLanauge brackets used to support indexing in jsp pages (i.e., ${...}) from a path.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public XPathUtils()
| Method Detail | 
|---|
public static String decodeXPath(String path)
path - NOT YET DOCUMENTED
public static String removeELbrackets(String s)
s - path containing el-encoded brackets
public static int getIndex(String s)
Works for both encoded indexing (e.g., "asdf_1_") and decoded (e.g., "asasdf[1]".
s - NOT YET DOCUMENTED
public static String encodeXPath(String s)
s - indexed xpath
public static String normalizeXPath(String s)
s - xpath possibly containing index notation
public static String getLeaf(String xpath)
xpath - NOT YET DOCUMENTED
public static boolean isAttributePath(String xpath)
xpath - xpath to be tested
public static String getNodeName(String xpath)
xpath - NOT YET DOCUMENTED
public static String getParentXPath(String xpath)
xpath - Description of the Parameter
public static String getSiblingXPath(String xpath)
(String) does).
xpath - XPath as String
public static int compare(String path1,
                          String path2)
NOTE: result of this comparison is not the same "document order", since XML documents are not structured in alpha order!
path1 - first path to be comparedpath2 - second path to be compared
  | 
DLESE Tools  v1.6.0  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||