Class XPathNormalizerWithXPath
java.lang.Object
de.wwu.scdh.annotation.selection.rewriter.XPathRewriterBase
de.wwu.scdh.annotation.selection.rewriter.XPathNormalizer
de.wwu.scdh.annotation.selection.rewriter.XPathNormalizerWithXPath
- All Implemented Interfaces:
Rewriter<DOMResource,XPathRefinedByRFC5147CharScheme, XPathRefinedByRFC5147CharScheme>
A
XPathNormalizer that generates normalized path
expressions by using an XPath expression that is evaluated on the
context node in question.
The context item on which the XPath will be evaluated, is
determined by XPathRewriterBase.getTextNodeAtPosition(S9ApiResource, String, int, Mode).
This is generally a text node.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.wwu.scdh.annotation.selection.Rewriter
Rewriter.Direction -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn XPath expression suitable for normalizing path expressions to nodes.static final StringAn XPath expression suitable for normalizing path expressions to nodes.static final StringAn XPath expression suitable for normalizing path expressions to nodes.Fields inherited from class de.wwu.scdh.annotation.selection.rewriter.XPathRewriterBase
EMPTY_NAMESPACE, TEXT_LEAF, TRACE_TEXT_LEAF, xpath, xPathCompiler -
Constructor Summary
ConstructorsConstructorDescriptionXPathNormalizerWithXPath(net.sf.saxon.s9api.XPathCompiler xPathCompiler, String xpath) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetNormalizedXPath(DOMResource resource, net.sf.saxon.s9api.XdmNode node, boolean escaped) Get the path to theXdmNodegiven as parameter by using the XPath expressing the normalizer was initialized with.Methods inherited from class de.wwu.scdh.annotation.selection.rewriter.XPathNormalizer
rewriteMethods inherited from class de.wwu.scdh.annotation.selection.rewriter.XPathRewriterBase
getDeepTextNodeAtPositionStepOverEnd, getDeepTextNodeAtPositionStopAtEnd, getDepth, getDepth, getDescendantTextNodesWithPosition, getFirstNodeAtPosition, getFirstOfDeepestNodesAtPosition, getLastOfDeepestNodesAtPosition, getNode, getNode, getNode, getSecondNodeAtPosition, getTextNodeAtPosition, getTextNodesWithPosition, getXPath, pathExpressionWithXPath, posInNormalizedNode, postProcForwardPaths, replaceEmptyNamespace, replaceTextLeaf, replaceTextLeaf, replaceTraceTextLeaf, reportNotFound, unespace
-
Field Details
-
PATH_FUNCTION_XPATH
An XPath expression suitable for normalizing path expressions to nodes. Generates a path expression using thepath(.)XPath function. This result in a path expression stepping from the root element to the context node. Element names are QNames in Clark notation.- See Also:
-
FROM_ROOT_CLARK_XPATH
An XPath expression suitable for normalizing path expressions to nodes.Generates a simple path expression stepping from the root element to the context node. Element names are QNames in Clark notation.
- See Also:
-
FROM_DEEPEST_ID_CLARK_XPATH
An XPath expression suitable for normalizing path expressions to nodes.Generates a path expression stepping from the deepest element with an XML-ID (
@xml:id) to the context node. Element names are QNames in Clark notation.- See Also:
-
-
Constructor Details
-
XPathNormalizerWithXPath
-
-
Method Details
-
getNormalizedXPath
protected String getNormalizedXPath(DOMResource resource, net.sf.saxon.s9api.XdmNode node, boolean escaped) throws SelectorException Get the path to theXdmNodegiven as parameter by using the XPath expressing the normalizer was initialized with.- Specified by:
getNormalizedXPathin classXPathNormalizer- Parameters:
node- anXdmNodeto which the normalized path must be generated toescaped- whether or not the normalized XPath is to be escaped for X-processing, e.g.,'escaped to'.- Returns:
- the normalized XPath expression as a String
- Throws:
SelectorException- See Also:
-