xpointer
Class XPointerAPI
java.lang.Object
|
+--xpointer.XPointerAPI
- public class XPointerAPI
- extends java.lang.Object
This class contains some methods for executing XPointer expression on an XML document.
Locations are returned; they may contain nodes or ranges (a point is a collapsed range).
The schemes supported are xpointer, xmlns and element.
Note that XPointer specification is under heavy remaking; for example, the element() scheme is used for
bare names and child sequences, which are not allowed in xpointer() scheme anymore.
Constructor Summary |
XPointerAPI()
Creates new XPointerAPI |
Method Summary |
static LocationList |
evalFullptr(org.w3c.dom.Node context,
java.lang.String fullptr)
Evaluates a full pointer which consists of one or more pointer parts.
|
static LocationList |
evalFullptr(org.w3c.dom.Node context,
java.lang.String fullptr,
Location here,
Location origin)
Evaluates a full pointer which consists of one or more pointer parts.
|
static LocationList |
selectLocationList(org.w3c.dom.Node context,
java.lang.String str)
Evaluates an XPointer expression.
|
static Location |
selectSinlgeLocation(org.w3c.dom.Node context,
java.lang.String str)
Evaluates an XPointer expression and returns the first selected location.
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPointerAPI
public XPointerAPI()
- Creates new XPointerAPI
selectLocationList
public static LocationList selectLocationList(org.w3c.dom.Node context,
java.lang.String str)
throws javax.xml.transform.TransformerException
- Evaluates an XPointer expression.
If no locations are selected, an empty list is returned.
- Parameters:
contextLocation
- the location to start searching fromstr
- the XPointer expression- Returns:
- a location list containing the selected locations
selectSinlgeLocation
public static Location selectSinlgeLocation(org.w3c.dom.Node context,
java.lang.String str)
throws javax.xml.transform.TransformerException
- Evaluates an XPointer expression and returns the first selected location.
If the expression does not select any locations, returns null.
- Parameters:
contextLocation
- the location to start searching fromstr
- the XPointer expression- Returns:
- the selected location, null if no locations are selected
evalFullptr
public static LocationList evalFullptr(org.w3c.dom.Node context,
java.lang.String fullptr)
throws javax.xml.transform.TransformerException
- Evaluates a full pointer which consists of one or more pointer parts.
Multiple pointers parts are evaluated from left to right, if the scheme identifies no resource
the next is evaluated. The result of the first pointer part whose evaluation succeedes is reported as the
subresource identified by the pointer as a whole.
- Parameters:
context
- the context node for the pointer evaluationfullptr
- a full pointer- Returns:
- the list of location selected by the first pointer which succeedes
evalFullptr
public static LocationList evalFullptr(org.w3c.dom.Node context,
java.lang.String fullptr,
Location here,
Location origin)
throws javax.xml.transform.TransformerException
- Evaluates a full pointer which consists of one or more pointer parts.
Multiple pointers parts are evaluated from left to right, if the scheme identifies no resource
the next is evaluated. The result of the first pointer part whose evaluation succeedes is reported as the
subresource identified by the pointer as a whole.
An application may provide values to be used for here() and origin functions.
- Parameters:
context
- the context node for the pointer evaluationfullptr
- a full pointerhere
- the location returned by the here() function,may be nullorigin
- the location returned by the origin() function,may be null- Returns:
- the list of location selected by the first pointer which succeedes