Package org.apache.xml.utils

Examples of org.apache.xml.utils.PrefixResolver


      }

      // Find the XSL template that is the best match for the
      // element.       
      XPathContext xctxt = getXPathContext();
      PrefixResolver savedPrefixResolver = xctxt.getNamespaceContext();

      try
      {
        xctxt.setNamespaceContext(xslInstruction);
        template = m_stylesheetRoot.getTemplateComposed(xctxt, child, mode, maxImportLevel,
View Full Code Here


                        + path);
                }
                result = XPathAPI.selectNodeList(dataNode, path);
            } else {
                XPathContext xpathSupport = new XPathContext();
                PrefixResolver prefixResolver =
                    new DataPrefixResolver(namespaces);
                XPath xpath = new XPath(path, null, prefixResolver,
                    XPath.SELECT);
                int ctxtNode = xpathSupport.getDTMHandleFromNode(dataNode);
                result = xpath.execute(xpathSupport, ctxtNode,
View Full Code Here

         * declaration has to be added
         *
         * Other prefixes with same URI are ignored. This is something to
         * talk about on mailinglist and a to WD
         */
        PrefixResolver prefixResolver = new PrefixResolverDefault(contextNode);
        String uri = prefixResolver.getNamespaceForPrefix(prefix);
        if (uri == null || !uri.equalsIgnoreCase(namespaceURI)) {
          ((Element) contextNode).setAttributeNS("http://www.w3.org/2000/xmlns/",
                  "xmlns:" + prefix, namespaceURI);
        }
      }
View Full Code Here

         * declaration has to be added
         *
         * Other prefixes with same URI are ignored. This is something to
         * talk about on mailinglist and a to WD
         */
        PrefixResolver prefixResolver = new PrefixResolverDefault(contextNode);
        String uri = prefixResolver.getNamespaceForPrefix(prefix);
        if (uri == null || !uri.equalsIgnoreCase(namespaceURI)) {
          ((Element) element).setAttributeNS("http://www.w3.org/2000/xmlns/",
                  "xmlns:" + prefix, namespaceURI);
        }
      }
View Full Code Here

        }
    }
    
    protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
        CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
        XObject list = cachedXPathAPI.eval(node, xpath, new PrefixResolver() {
            public String getNamespaceForPrefix(String prefix) {
                if (prefix.equals("jbi")) {
                    return "http://java.sun.com/xml/ns/jbi/management-message";
                }
                return null;
View Full Code Here

      if ( "".equals( value ) )
      {
         return null;
      }

      PrefixResolver prefixResolver = new PrefixResolverDefault( xsdElem.getSchemaElement(  ) );
      QName          propName = null;
      try
      {
         propName = toQName( value, prefixResolver );
      }
View Full Code Here

               continue;

            Node n = d.getDocumentElement();

            XPathContext xpc = new XPathContext();
            PrefixResolver pfx;
            if ( pr == null ) {
               pfx = new PrefixResolverDefault(d.getDocumentElement());
               xp = new XPath(xpath, null, pfx, XPath.SELECT, null);
            }
            else {
View Full Code Here

      // Since we don't have a XML Parser involved here, install some default
      // support for things like namespaces, etc.
      XPathContext xpathSupport = new XPathContext();

      PrefixResolver prefixResolver = null;
      // Create an object to resolve namespace prefixes.
      if ( namespace != null ) {
         if ( namespace.getNodeType() == Node.DOCUMENT_NODE ) {
            namespace = ((Document)namespace).getDocumentElement();
         }
View Full Code Here

            xpathExpressionContext = ((Document) contextNode).getDocumentElement();
        }
        else {
            xpathExpressionContext = contextNode;
        }
        final PrefixResolver prefixResolver = new HtmlUnitPrefixResolver(xpathExpressionContext);
        final boolean caseSensitive = contextNode.getPage().hasCaseSensitiveTagNames();
        final XPathAdapter xpath = new XPathAdapter(str, null, prefixResolver, null, caseSensitive);
        final int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
        return xpath.execute(xpathSupport, ctxtNode, prefixResolver);
    }
View Full Code Here

        // Since we don't have a XML Parser involved here, install some default
        // support for things like namespaces, etc.
        XPathContext xpathSupport = new XPathContext();

        PrefixResolver prefixResolver = null;
        // Create an object to resolve namespace prefixes.
        if (namespace != null) {
            if (namespace.getNodeType() == Node.DOCUMENT_NODE) {
                namespace = ((Document) namespace).getDocumentElement();
            }
View Full Code Here

TOP

Related Classes of org.apache.xml.utils.PrefixResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.