- public class QNameLocator
- extends Object
This class helps to determine if a QName is present within the XML.
This uses the XmlCursor interface to help with this operation. Note that
if indeed there is such an element, the cursor is appropriately positioned
at the right location. One can then use xmlText() to retrive the XML text
and parse accordingly to access sub-elements if any within the element.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public String moduleName
public static QNameLocator getInstance()
public boolean locateQName(XmlCursor cursor,
- Locate the QName based on the specified XmlCursor.
- true If we are able to successfully locate the QName. Please note
that the cursor is positioned at the location where the element is
successfully located. Note that since the cursor is positioned at the
location at which the element is found, this method does not reposition
the cursor's temporarily saved location iff it returns a true.
Please make sure you use cursor.pop() to erase the stack storage
of the temporary location if your program's logic so demands.
Thus, if you did cursor.push() prior to calling this method, and if
a QName has been located by this method. cursor.pop() at a subsequent time
can lead to aberrant results. You need to do cursor.pop() again in such
public int locateQNameAndDepth(XmlCursor cursor,