Class XalanXPathAPI

  • All Implemented Interfaces:
    XPathAPI

    public class XalanXPathAPI
    extends java.lang.Object
    implements XPathAPI
    An implementation of XPathAPI using Xalan. This supports the "here()" function defined in the digital signature spec.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.xpath.XPathContext context  
      private static org.apache.xpath.compiler.FunctionTable funcTable  
      private static boolean installed  
      private static org.slf4j.Logger LOG  
      private org.apache.xpath.XPath xpath  
      private java.lang.String xpathStr  
    • Constructor Summary

      Constructors 
      Constructor Description
      XalanXPathAPI()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clear any context information from this object
      private org.apache.xpath.XPath createXPath​(java.lang.String str, org.apache.xml.utils.PrefixResolver prefixResolver)  
      private org.apache.xpath.objects.XObject eval​(org.w3c.dom.Node contextNode, org.w3c.dom.Node xpathnode, java.lang.String str, org.w3c.dom.Node namespaceNode)  
      boolean evaluate​(org.w3c.dom.Node contextNode, org.w3c.dom.Node xpathnode, java.lang.String str, org.w3c.dom.Node namespaceNode)
      Evaluate an XPath string and return true if the output is to be included or not.
      private static void fixupFunctionTable()  
      static boolean isInstalled()  
      org.w3c.dom.NodeList selectNodeList​(org.w3c.dom.Node contextNode, org.w3c.dom.Node xpathnode, java.lang.String str, org.w3c.dom.Node namespaceNode)
      Use an XPath string to select a nodelist.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • xpathStr

        private java.lang.String xpathStr
      • xpath

        private org.apache.xpath.XPath xpath
      • funcTable

        private static org.apache.xpath.compiler.FunctionTable funcTable
      • installed

        private static boolean installed
      • context

        private org.apache.xpath.XPathContext context
    • Constructor Detail

      • XalanXPathAPI

        public XalanXPathAPI()
    • Method Detail

      • selectNodeList

        public org.w3c.dom.NodeList selectNodeList​(org.w3c.dom.Node contextNode,
                                                   org.w3c.dom.Node xpathnode,
                                                   java.lang.String str,
                                                   org.w3c.dom.Node namespaceNode)
                                            throws javax.xml.transform.TransformerException
        Use an XPath string to select a nodelist. XPath namespace prefixes are resolved from the namespaceNode.
        Specified by:
        selectNodeList in interface XPathAPI
        Parameters:
        contextNode - The node to start searching from.
        xpathnode -
        str -
        namespaceNode - The node from which prefixes in the XPath will be resolved to namespaces.
        Returns:
        A NodeIterator, should never be null.
        Throws:
        javax.xml.transform.TransformerException
      • evaluate

        public boolean evaluate​(org.w3c.dom.Node contextNode,
                                org.w3c.dom.Node xpathnode,
                                java.lang.String str,
                                org.w3c.dom.Node namespaceNode)
                         throws javax.xml.transform.TransformerException
        Evaluate an XPath string and return true if the output is to be included or not.
        Specified by:
        evaluate in interface XPathAPI
        Parameters:
        contextNode - The node to start searching from.
        xpathnode - The XPath node
        str - The XPath expression
        namespaceNode - The node from which prefixes in the XPath will be resolved to namespaces.
        Throws:
        javax.xml.transform.TransformerException
      • clear

        public void clear()
        Clear any context information from this object
        Specified by:
        clear in interface XPathAPI
      • isInstalled

        public static boolean isInstalled()
      • eval

        private org.apache.xpath.objects.XObject eval​(org.w3c.dom.Node contextNode,
                                                      org.w3c.dom.Node xpathnode,
                                                      java.lang.String str,
                                                      org.w3c.dom.Node namespaceNode)
                                               throws javax.xml.transform.TransformerException
        Throws:
        javax.xml.transform.TransformerException
      • createXPath

        private org.apache.xpath.XPath createXPath​(java.lang.String str,
                                                   org.apache.xml.utils.PrefixResolver prefixResolver)
                                            throws javax.xml.transform.TransformerException
        Throws:
        javax.xml.transform.TransformerException
      • fixupFunctionTable

        private static void fixupFunctionTable()