Examples of XPathParser

  • org.apache.xpath.compiler.XPathParser
    Tokenizes and parses XPath expressions. This should really be named XPathParserImpl, and may be renamed in the future.
  • org.eclipse.wst.xml.xpath2.processor.XPathParser
  • our.apache.commons.jxpath.ri.parser.XPathParser

  • Examples of org.apache.xpath.compiler.XPathParser

        if(null == errorListener)
          errorListener = new org.apache.xml.utils.DefaultErrorHandler();
       
        m_patternString = exprString;

        XPathParser parser = new XPathParser(errorListener, locator);
        Compiler compiler = new Compiler(errorListener, locator);

        if (SELECT == type)
          parser.initXPath(compiler, exprString, prefixResolver);
        else if (MATCH == type)
          parser.initMatchPattern(compiler, exprString, prefixResolver);
        else
          throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);

        // System.out.println("----------------");
        Expression expr = compiler.compile(0);
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

        if(null == errorListener)
          errorListener = new org.apache.xml.utils.DefaultErrorHandler();
       
        m_patternString = exprString;

        XPathParser parser = new XPathParser(errorListener, locator);
        Compiler compiler = new Compiler(errorListener, locator);

        if (SELECT == type)
          parser.initXPath(compiler, exprString, prefixResolver);
        else if (MATCH == type)
          parser.initMatchPattern(compiler, exprString, prefixResolver);
        else
          throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);

        // System.out.println("----------------");
        Expression expr = compiler.compile(0);
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

         
          // Try a bunch of really ugly stuff to find the fragment.
          // What's the right way to do this?

          // Create a XPath parser.
          XPathParser parser = new XPathParser((ErrorListener)m_problemListener.getErrorHandler(), null);
          XPathContext xpathContext = new XPathContext();
          PrefixResolverDefault nsNode = new PrefixResolverDefault(fragBase); //xpathContext.getNamespaceContext();

          NodeIterator nl = null;
          // Create the XPath object.
          try{
          XPath xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
          Compiler compiler = new Compiler();
          // Parse the xpath
          parser.initXPath(compiler, "id("+fragID+")", nsNode);
          org.apache.xpath.objects.XObject xobj = xpath.execute(xpathContext, fragBase, nsNode);

          nl = xobj.nodeset();
          if(nl.nextNode() == null)
          {
            // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@id='"+fragID+"']", fragBase, nsNode);
            // Create the XPath object.
            xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

            // Parse the xpath
            parser.initXPath(compiler, "//*[@id='"+fragID+"']", nsNode);
            xobj = xpath.execute(xpathContext, fragBase, nsNode);

            nl = xobj.nodeset();
            if(nl.nextNode() == null)
            {
              // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@name='"+fragID+"']", fragBase, nsNode);
              // Create the XPath object.
              xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

              // Parse the xpath
              parser.initXPath(compiler, "//*[@name='"+fragID+"']", nsNode);
              xobj = xpath.execute(xpathContext, fragBase, nsNode);
              nl = xobj.nodeset();
              if(nl.nextNode() == null)
              {
                // Well, hell, maybe it's an XPath...
                // xobj = Stylesheet.evalXPathStr(getExecContext(), fragID, fragBase, nsNode);
                // Create the XPath object.
                //((StylesheetHandler)( m_processor.getTemplatesBuilder())).getLocator()
                xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

                // Parse the xpath
                parser.initXPath(compiler, fragID, nsNode);
                xobj = xpath.execute(xpathContext, fragBase, nsNode);
                nl = xobj.nodeset();
              }
            }
          }
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

        if(null == errorListener)
          errorListener = new org.apache.xml.utils.DefaultErrorHandler();
       
        m_patternString = exprString;

        XPathParser parser = new XPathParser(errorListener, locator);
        Compiler compiler = new Compiler(errorListener, locator);

        if (SELECT == type)
          parser.initXPath(compiler, exprString, prefixResolver);
        else if (MATCH == type)
          parser.initMatchPattern(compiler, exprString, prefixResolver);
        else
          throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_CANNOT_DEAL_XPATH_TYPE, new Object[]{Integer.toString(type)})); //"Can not deal with XPath type: " + type);

        // System.out.println("----------------");
        Expression expr = compiler.compile(0);
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

         
          // Try a bunch of really ugly stuff to find the fragment.
          // What's the right way to do this?

          // Create a XPath parser.
          XPathParser parser = new XPathParser((ErrorListener)m_problemListener.getErrorHandler(), null);
          XPathContext xpathContext = new XPathContext();
          PrefixResolverDefault nsNode = new PrefixResolverDefault(fragBase); //xpathContext.getNamespaceContext();

          NodeIterator nl = null;
          // Create the XPath object.
          try{
          XPath xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
          Compiler compiler = new Compiler();
          // Parse the xpath
          parser.initXPath(compiler, "id("+fragID+")", nsNode);
          org.apache.xpath.objects.XObject xobj = xpath.execute(xpathContext, fragBase, nsNode);

          nl = xobj.nodeset();
          if(nl.nextNode() == null)
          {
            // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@id='"+fragID+"']", fragBase, nsNode);
            // Create the XPath object.
            xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

            // Parse the xpath
            parser.initXPath(compiler, "//*[@id='"+fragID+"']", nsNode);
            xobj = xpath.execute(xpathContext, fragBase, nsNode);

            nl = xobj.nodeset();
            if(nl.nextNode() == null)
            {
              // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@name='"+fragID+"']", fragBase, nsNode);
              // Create the XPath object.
              xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

              // Parse the xpath
              parser.initXPath(compiler, "//*[@name='"+fragID+"']", nsNode);
              xobj = xpath.execute(xpathContext, fragBase, nsNode);
              nl = xobj.nodeset();
              if(nl.nextNode() == null)
              {
                // Well, hell, maybe it's an XPath...
                // xobj = Stylesheet.evalXPathStr(getExecContext(), fragID, fragBase, nsNode);
                // Create the XPath object.
                //((StylesheetHandler)( m_processor.getTemplatesBuilder())).getLocator()
                xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

                // Parse the xpath
                parser.initXPath(compiler, fragID, nsNode);
                xobj = xpath.execute(xpathContext, fragBase, nsNode);
                nl = xobj.nodeset();
              }
            }
          }
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

        if(null == errorListener)
          errorListener = new org.apache.xml.utils.DefaultErrorHandler();
       
        m_patternString = exprString;

        XPathParser parser = new XPathParser(errorListener, locator);
        Compiler compiler = new Compiler(errorListener, locator);

        if (SELECT == type)
          parser.initXPath(compiler, exprString, prefixResolver);
        else if (MATCH == type)
          parser.initMatchPattern(compiler, exprString, prefixResolver);
        else
          throw new RuntimeException("Can not deal with XPath type: " + type);

        // System.out.println("----------------");
        Expression expr = compiler.compile(0);
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

        if(null == errorListener)
          errorListener = new org.apache.xml.utils.DefaultErrorHandler();
       
        m_patternString = exprString;

        XPathParser parser = new XPathParser(errorListener, locator);
        Compiler compiler = new Compiler(errorListener, locator);

        if (SELECT == type)
          parser.initXPath(compiler, exprString, prefixResolver);
        else if (MATCH == type)
          parser.initMatchPattern(compiler, exprString, prefixResolver);
        else
          throw new RuntimeException("Can not deal with XPath type: " + type);

        // System.out.println("----------------");
        Expression expr = compiler.compile(0);
    View Full Code Here

    Examples of org.apache.xpath.compiler.XPathParser

         
          // Try a bunch of really ugly stuff to find the fragment.
          // What's the right way to do this?

          // Create a XPath parser.
          XPathParser parser = new XPathParser((ErrorListener)m_problemListener.getErrorHandler(), null);
          XPathContext xpathContext = new XPathContext();
          PrefixResolverDefault nsNode = new PrefixResolverDefault(fragBase); //xpathContext.getNamespaceContext();

          NodeIterator nl = null;
          // Create the XPath object.
          try{
          XPath xpath = new XPath(fragID, null, nsNode, XPath.MATCH);
          Compiler compiler = new Compiler();
          // Parse the xpath
          parser.initXPath(compiler, "id("+fragID+")", nsNode);
          org.apache.xpath.objects.XObject xobj = xpath.execute(xpathContext, fragBase, nsNode);

          nl = xobj.nodeset();
          if(nl.nextNode() == null)
          {
            // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@id='"+fragID+"']", fragBase, nsNode);
            // Create the XPath object.
            xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

            // Parse the xpath
            parser.initXPath(compiler, "//*[@id='"+fragID+"']", nsNode);
            xobj = xpath.execute(xpathContext, fragBase, nsNode);

            nl = xobj.nodeset();
            if(nl.nextNode() == null)
            {
              // xobj = Stylesheet.evalXPathStr(getExecContext(), "//*[@name='"+fragID+"']", fragBase, nsNode);
              // Create the XPath object.
              xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

              // Parse the xpath
              parser.initXPath(compiler, "//*[@name='"+fragID+"']", nsNode);
              xobj = xpath.execute(xpathContext, fragBase, nsNode);
              nl = xobj.nodeset();
              if(nl.nextNode() == null)
              {
                // Well, hell, maybe it's an XPath...
                // xobj = Stylesheet.evalXPathStr(getExecContext(), fragID, fragBase, nsNode);
                // Create the XPath object.
                //((StylesheetHandler)( m_processor.getTemplatesBuilder())).getLocator()
                xpath = new XPath(fragID, null, nsNode, XPath.MATCH);

                // Parse the xpath
                parser.initXPath(compiler, fragID, nsNode);
                xobj = xpath.execute(xpathContext, fragBase, nsNode);
                nl = xobj.nodeset();
              }
            }
          }
    View Full Code Here

    Examples of org.eclipse.wst.xml.xpath2.processor.XPathParser

         * Compile an XPath string, and return the compiled XPath expression.
         */
        protected XPath compileXPathStr(String xpathStr,
                                        XSAssertImpl assertImpl,
                                        XSDHandler fSchemaHandler) {       
            XPathParser xpp = new JFlexCupParser();
            XPath xp = null;
           
            try {
                xp = xpp.parse("boolean(" + xpathStr + ")");
            } catch (XPathParserException ex) {
                // error compiling XPath expression
                reportError("cvc-xpath.3.13.4.2", assertImpl, fSchemaHandler);
           
           
    View Full Code Here

    Examples of org.eclipse.wst.xml.xpath2.processor.XPathParser

                                           schemaDoc.fNamespaceSupport);
                }
                catch (XPathException e) {
                   // fall back to full XPath 2.0 support, with PsychoPath engine
                   try {
                      XPathParser xpp = new JFlexCupParser();
                      XPath xp = xpp.parse("boolean(" + test + ")");
                      testExpr = new Test(xp, typeAlternative, schemaDoc.fNamespaceSupport);
                   } catch(XPathParserException ex) {
                      reportSchemaError("c-cta-xpath", new Object[] { test }, altElement);
                      //if the XPath is invalid, create a Test without an expression
                      testExpr = new Test((XPath20) null, typeAlternative,
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.