public class TransformImplXPath extends Transform
| Modifier and Type | Class and Description |
|---|---|
protected class |
TransformImplXPath.NSDeclaration
Auxilary class representing a XML namespace declaration structure.
|
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_ALGORITHM_URI_
The default algorithm URI for this algorithm implementation.
|
protected java.lang.String |
xPath_
The XPath expression to be processed by this algorithm.
|
protected java.util.ArrayList |
xPathNSDeclarations_
The namespace declarations to be added to the XPath parameter element.
|
protected org.w3c.dom.Element |
xPathParamDOMElem_
The XPath parameter element which will act as the namespace context node for the XPath transform.
|
inputNodeSet_, inputOctetStream_, inputURI_| Constructor and Description |
|---|
TransformImplXPath()
Standard constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNSDeclaration(java.lang.String nSPrefix,
URI nSURI)
Adds a namespace declaration to the list of namespace declarations, which will be used as the namespace
context at evaluation of the XPath expression of this transform.
|
protected void |
checkBackingDOM()
In case that the XPath expression contains the here() function, checks if the input node set is backed
by the same DOM instance as the DOM representation of the XPath parameter element.
|
java.lang.String |
getXPath()
Gets the XPath expression to be processed by this transform.
|
org.w3c.dom.Element |
getXPathElement()
Gets the XPath DOM element of this transform.
|
void |
setParameters(org.w3c.dom.Element transformElement)
Sets the parameters for this XPath transform implementation.
|
void |
setXPath(java.lang.String xPath)
Sets the XPath expression to be processed by this transform.
|
org.w3c.dom.Element |
toElement(org.w3c.dom.Document signatureDOMDoc)
Returns the DOM element representation of the transform.
|
java.lang.Object |
transform()
Computes the transform result for the previously specified input.
|
distributeNSDeclarations, setInput, setInput, skipStylesheetElem, withdrawDistributedNSDeclarationsprotected static final java.lang.String DEFAULT_ALGORITHM_URI_
protected java.lang.String xPath_
protected org.w3c.dom.Element xPathParamDOMElem_
protected java.util.ArrayList xPathNSDeclarations_
public TransformImplXPath()
http://www.w3.org/TR/1999/REC-xpath-19991116.public void setParameters(org.w3c.dom.Element transformElement)
throws AlgorithmException
setParameters in class AlgorithmtransformElement - The DOM element representation of the transform, as it will be found by IXSIL
in the XML signature.AlgorithmException - if the XPath parameter element cannot be found, or if the Xpath
meter element does not contain any text value, or if setting the
parameter fails for any other reason.public org.w3c.dom.Element getXPathElement()
public void setXPath(java.lang.String xPath)
xPath - The XPath expression to be processed by this transform.public java.lang.String getXPath()
public void addNSDeclaration(java.lang.String nSPrefix,
URI nSURI)
nSPrefix - The namespace prefix to be declared. Must not be null and must not be the
empty string.nSURI - The namespace URI for the namespace prefix to be declared. Must not be null
and must not be the empty string.public org.w3c.dom.Element toElement(org.w3c.dom.Document signatureDOMDoc)
throws AlgorithmException
toElement in class AlgorithmsignatureDOMDoc - The DOM document which should be used to create necessary DOM nodes.AlgorithmException - if no identifying URI has been specified for this transform, or if no
XPath expression has been specified for this transform.public java.lang.Object transform()
throws AlgorithmException
transform in class TransformAlgorithmException - if no input has been set previously, or if no XPath expression has been
set previously, or if converting a input octet stream into a XPath node
set input fails, or if performing the transform fails for any reason.protected void checkBackingDOM()
throws AlgorithmException
AlgorithmException - if the condition specified above is not met.