Package net.sf.saxon.sxpath

Examples of net.sf.saxon.sxpath.XPathDynamicContext


      if (proColumn.isOrdinal()) {
        tuple.add(rowCount);
      } else {
        try {
          XPathExpression path = proColumn.getPathExpression();
          XPathDynamicContext dynamicContext = path.createDynamicContext(item);
          SequenceIterator pathIter = path.iterate(dynamicContext);
          Item colItem = pathIter.next();
          if (colItem == null) {
            if (proColumn.getDefaultExpression() != null) {
              tuple.add(getEvaluator(Collections.emptyMap()).evaluate(proColumn.getDefaultExpression(), null));
View Full Code Here


            XPathVariable thisVar = xpe.declareVariable("", contextVar);
            XPathExpression xpath = xpe.createExpression(path);
            NodeInfo contextItem =
                //config.buildDocument(new DOMSource(contextNode));
                config.unravel(new DOMSource(contextNode));
            XPathDynamicContext dc = xpath.createDynamicContext(null);
            dc.setContextItem(contextItem);
            dc.setVariable(thisVar, contextItem);

            List saxonNodes = xpath.evaluate(dc);
            for (ListIterator it = saxonNodes.listIterator(); it.hasNext(); )
            {
                Object o = it.next();
View Full Code Here

                dynamicEnv.setParameter(argname.substring(1), sources);
            } else if (argname.startsWith("?")) {
                // parameters starting with "?" are taken as XPath expressions
                XPathEvaluator xpe = new XPathEvaluator(getConfiguration());
                XPathExpression expr = xpe.createExpression(argvalue);
                XPathDynamicContext context = expr.createDynamicContext(null);
                ValueRepresentation val = SequenceExtent.makeSequenceExtent(expr.iterate(context));
                dynamicEnv.setParameter(argname.substring(1), val);               
            } else {
                dynamicEnv.setParameter(argname, new UntypedAtomicValue(argvalue));
            }
View Full Code Here

                controller.setParameter(argname.substring(1), sources);
            } else if (argname.startsWith("?")) {
                // parameters starting with "?" are taken as XPath expressions
                XPathEvaluator xpe = new XPathEvaluator(controller.getConfiguration());
                XPathExpression expr = xpe.createExpression(argvalue);
                XPathDynamicContext context = expr.createDynamicContext(null);
                ValueRepresentation val = SequenceExtent.makeSequenceExtent(expr.iterate(context));
                controller.setParameter(argname.substring(1), val);
            } else {
                controller.setParameter(argname, new UntypedAtomicValue(argvalue));
            }
View Full Code Here

                XPathExpression xexpr = xexec.getUnderlyingExpression();

                // Call createDynamicContext() on this to get an XPathDynamicContext object;

                XPathDynamicContext xdc = xexpr.createDynamicContext(node.getUnderlyingNode());

                // call getXPathContextObject() on that to get the underlying XPathContext.

                XPathContext xc = xdc.getXPathContextObject();

                // Then call XPathContext.setCurrentIterator()
                // to supply a SequenceIterator whose current() and position() methods return
                // the context item and position respectively. If there's any risk that the
                // expression will call the last() method, then it's simplest to make your
View Full Code Here

        return destination.getXdmNode();
    }

    public boolean matches(XdmNode node) {
        try {
            XPathDynamicContext context = matcher.createDynamicContext(node.getUnderlyingNode());
            return matcher.effectiveBooleanValue(context);
        } catch (XPathException sae) {
            return false;
        }
    }
View Full Code Here

            Item item = null;

            try {
                // Call createDynamicContext() on this to get an XPathDynamicContext object;

                XPathDynamicContext xdc = xexpr.createDynamicContext(doc.getUnderlyingNode());

                // call getXPathContextObject() on that to get the underlying XPathContext.

                XPathContext xc = xdc.getXPathContextObject();

                // Then call XPathContext.setCurrentIterator()
                // to supply a SequenceIterator whose current() and position() methods return
                // the context item and position respectively. If there's any risk that the
                // expression will call the last() method, then it's simplest to make your
View Full Code Here

TOP

Related Classes of net.sf.saxon.sxpath.XPathDynamicContext

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.