Package org.apache.xml.utils

Examples of org.apache.xml.utils.PrefixResolver


                  continue;

               Node n = d.getDocumentElement();

               XPathContext xpc = new XPathContext();
               PrefixResolver pfx;
               if ( pr == null ) {
                  pfx = new PrefixResolverDefault(d.getDocumentElement());
                  xp = new XPath(query, null, pfx, XPath.SELECT, errors);
               }
               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)
      {
View Full Code Here

    public Object createXPath(String xpath) throws XPathException {
        return xpath;
    }
    public XResult evaluateXPath(Node node, Object xpath, NamespaceContext nsContext) throws XPathException {
        try {
            PrefixResolver pr = nsContext!=null ? new NSResolver(nsContext) : null;
            XObject res = XPathAPI.eval(node,(String)xpath,pr);
            return convertResult(res);
        } catch(Exception e) {
            throw new XPathException(e,"Error while evaluating XPath {0}",xpath.toString()); // $NLS-AbstractXercesDriver.ErrorwhileevaluatingXPath0-1$
        }
View Full Code Here

    public XResult evaluateXPath(NodeList nodeList, Object xpath, NamespaceContext nsContext) throws XPathException {
        try {
            if(nodeList.getLength()>0) {
                XResult result = null;
                NodeListImpl nodes = null;
                PrefixResolver pr = nsContext!=null ? new NSResolver(nsContext) : null;
                for( int i=0; i<nodeList.getLength(); i++ ) {
                    XObject res = XPathAPI.eval(nodeList.item(i),(String)xpath,pr);
                    switch(res.getType()) {
                        case XObject.CLASS_BOOLEAN: {
                            if(nodes!=null) {
View Full Code Here

    public Object createXPath(String xpath) throws XPathException {
        return xpath;
    }
    public XResult evaluateXPath(Node node, Object xpath, NamespaceContext nsContext) throws XPathException {
        try {
            PrefixResolver pr = nsContext!=null ? new NSResolver(nsContext) : null;
            XObject res = XPathAPI.eval(node,(String)xpath,pr);
            return convertResult(res);
        } catch(Exception e) {
            throw new XPathException(e,"Error while evaluating XPath {0}",xpath.toString()); // $NLS-AbstractXercesDriver.ErrorwhileevaluatingXPath0-1$
        }
View Full Code Here

    public XResult evaluateXPath(NodeList nodeList, Object xpath, NamespaceContext nsContext) throws XPathException {
        try {
            if(nodeList.getLength()>0) {
                XResult result = null;
                NodeListImpl nodes = null;
                PrefixResolver pr = nsContext!=null ? new NSResolver(nsContext) : null;
                for( int i=0; i<nodeList.getLength(); i++ ) {
                    XObject res = XPathAPI.eval(nodeList.item(i),(String)xpath,pr);
                    switch(res.getType()) {
                        case XObject.CLASS_BOOLEAN: {
                            if(nodes!=null) {
View Full Code Here

                          boolean isTopLevel,
                          int stackFrame,
                          Expression expr )
    throws org.apache.xml.utils.WrappedRuntimeException
  {
    PrefixResolver savedResolver = xctxt.getNamespaceContext();
    XNodeSet result = null;

    try
    {
      xctxt.pushCurrentNode(context);
View Full Code Here

    int nPredicates = getPredicateCount();
    // System.out.println("nPredicates: "+nPredicates);
    if (nPredicates == 0)
      return true;

    PrefixResolver savedResolver = xctxt.getNamespaceContext();

    try
    {
      m_predicateIndex = 0;
      xctxt.pushSubContextList(this);
View Full Code Here

        }

        Node n = d.getDocumentElement();

        XPathContext xpc = new XPathContext();
        PrefixResolver pfx;
        if (pr == null)
        {
          pfx = new PrefixResolverDefault(d.getDocumentElement());
          xp = new XPath(query, null, pfx, XPath.SELECT, errors);
        }
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.