public final class XPathHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static javax.xml.xpath.XPathFactory |
getFactory() |
static <T extends org.apache.xmlbeans.XmlObject> |
selectProperty(org.apache.xmlbeans.XmlObject startObject,
java.lang.Class<T> resultClass,
XSLFShape.ReparseFactory<T> factory,
javax.xml.namespace.QName[]... path)
Internal code - API may change any time!
|
public static javax.xml.xpath.XPathFactory getFactory()
@Internal public static <T extends org.apache.xmlbeans.XmlObject> T selectProperty(org.apache.xmlbeans.XmlObject startObject, java.lang.Class<T> resultClass, XSLFShape.ReparseFactory<T> factory, javax.xml.namespace.QName[]... path) throws org.apache.xmlbeans.XmlException
The #selectProperty(Class, String)
xquery method has some performance penalties,
which can be workaround by using XmlCursor
. This method also takes into account
that AlternateContent
tags can occur anywhere on the given path.
It returns the first element found - the search order is:
resultClass
- the requested result classfactory
- a factory parse method reference to allow reparsing of elements
extracted from AlternateContent elements. Usually the enclosing XmlBeans type needs to be used
to parse the streampath
- the elements path, each array must contain at least 1 QName,
but can contain additional alternative tagsorg.apache.xmlbeans.XmlException
- If factory is null, a XmlException is
thrown if the AlternateContent is not allowed by the surrounding element or if the
extracted object is of the generic type XmlAnyTypeImpl.Copyright 2021 The Apache Software Foundation or its licensors, as applicable.