/** * Write the value into the buffer. * * @param xctxt An XPathContext object, providing infomation specific * to this invocation and this thread. Maintains SAX state, variables, * error handler and so on, so the transformation/XPath object itself * can be simultaneously invoked from multiple threads. * @param buf Buffer to write into. * @param context The current source tree context. * @param nsNode The current namespace context (stylesheet tree context). * * @throws javax.xml.transform.TransformerException */ public void evaluate( XPathContext xctxt, FastStringBuffer buf, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { XObject xobj = m_xpath.execute(xctxt, context, nsNode); if (null != xobj) { xobj.appendToFsb(buf); } }
/** * Given an expression and a context, evaluate the XPath * and return the result. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @param namespaceContext The context in which namespaces in the * XPath are supposed to be expanded. * * @return The result of the XPath or null if callbacks are used. * @throws TransformerException thrown if * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public XObject execute( XPathContext xctxt, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { return execute( xctxt, xctxt.getDTMHandleFromNode(contextNode), namespaceContext); }
/** * Write the value into the buffer. * * @param xctxt An XPathContext object, providing infomation specific * to this invocation and this thread. Maintains SAX state, variables, * error handler and so on, so the transformation/XPath object itself * can be simultaneously invoked from multiple threads. * @param buf Buffer to write into. * @param context The current source tree context. * @param nsNode The current namespace context (stylesheet tree context). * * @throws javax.xml.transform.TransformerException */ public void evaluate( XPathContext xctxt, FastStringBuffer buf, int context, org.apache.xml.utils.PrefixResolver nsNode) throws javax.xml.transform.TransformerException { XObject xobj = m_xpath.execute(xctxt, context, nsNode); if (null != xobj) { xobj.appendToFsb(buf); } }
/** * Given an expression and a context, evaluate the XPath * and return the result. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @param namespaceContext The context in which namespaces in the * XPath are supposed to be expanded. * * @return The result of the XPath or null if callbacks are used. * @throws TransformerException thrown if * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public XObject execute( XPathContext xctxt, org.w3c.dom.Node contextNode, PrefixResolver namespaceContext) throws javax.xml.transform.TransformerException { return execute( xctxt, xctxt.getDTMHandleFromNode(contextNode), namespaceContext); }
private XObject eval(String expression, Object contextItem) throws javax.xml.transform.TransformerException { org.apache.xpath.XPath xpath = new org.apache.xpath.XPath( expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } XObject xobj = null; xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); // If item is null, then we will create a a Dummy contextNode if ( contextItem instanceof Node ) { xobj = xpath.execute (xpathSupport, (Node)contextItem, prefixResolver ); } else { xobj = xpath.execute ( xpathSupport, DTM.NULL, prefixResolver ); } return xobj; }
private XObject eval(String expression, Object contextItem) throws javax.xml.transform.TransformerException { org.apache.xpath.XPath xpath = new org.apache.xpath.XPath( expression, null, prefixResolver, org.apache.xpath.XPath.SELECT ); org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } XObject xobj = null; xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); // If item is null, then we will create a a Dummy contextNode if ( contextItem instanceof Node ) { xobj = xpath.execute (xpathSupport, (Node)contextItem, prefixResolver ); } else { xobj = xpath.execute ( xpathSupport, DTM.NULL, prefixResolver ); } return xobj; }
XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this);
XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this);
private XObject eval ( Object contextItem ) throws javax.xml.transform.TransformerException { org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); XObject xobj = null; Node contextNode = (Node)contextItem; // We always need to have a ContextNode with Xalan XPath implementation // To allow simple expression evaluation like 1+1 we are setting // dummy Document as Context Node if ( contextNode == null ) { contextNode = getDummyDocument(); } xobj = xpath.execute(xpathSupport, contextNode, prefixResolver ); return xobj; }
private XObject eval ( Object contextItem ) throws javax.xml.transform.TransformerException { org.apache.xpath.XPathContext xpathSupport = null; // Create an XPathContext that doesn't support pushing and popping of // variable resolution scopes. Sufficient for simple XPath 1.0 // expressions. if ( functionResolver != null ) { JAXPExtensionsProvider jep = new JAXPExtensionsProvider( functionResolver, featureSecureProcessing ); xpathSupport = new org.apache.xpath.XPathContext(jep, false); } else { xpathSupport = new org.apache.xpath.XPathContext(false); } xpathSupport.setVarStack(new JAXPVariableStack(variableResolver)); XObject xobj = null; Node contextNode = (Node)contextItem; // We always need to have a ContextNode with Xalan XPath implementation // To allow simple expression evaluation like 1+1 we are setting // dummy Document as Context Node if ( contextNode == null ) { contextNode = getDummyDocument(); } xobj = xpath.execute(xpathSupport, contextNode, prefixResolver ); return xobj; }
XPath xpath = new XPath(xpathQuery, null, customPrefixResolver, XPath.SELECT, null); int ctxtNode = xpathContext.getDTMHandleFromNode(node); XObject xresult = xpath.execute(xpathContext, ctxtNode, customPrefixResolver); if (xresult instanceof XNodeSet) { NodeListModel result = new NodeListModel(node);
var = m_selectPattern.execute(xctxt, sourceNode, this);
(KeyDeclaration) keyDecls.elementAt(keyDeclIdx); XObject xuse = keyDeclaration.getUse().execute(xctxt, currentNode, ki.getPrefixResolver());
(KeyDeclaration) keyDecls.elementAt(keyDeclIdx); XObject xuse = keyDeclaration.getUse().execute(xctxt, currentNode, ki.getPrefixResolver());
var = m_selectPattern.execute(xctxt, sourceNode, this);
XPath.SELECT); return dynamicXPath.execute(xctxt, myContext.getContextNode(), xctxt.getNamespaceContext());
var = m_selectPattern.execute(xctxt, sourceNode, this);
= context.getTransformer().getXPathContext(); XPath myxpath = new XPath(fileNameExpr, elem, xctxt.getNamespaceContext(), XPath.SELECT); XObject xobj = myxpath.execute(xctxt, context.getContextNode(), elem); fileName = xobj.str(); if((null == fileName) || (fileName.length() == 0))
XObject test = m_test.execute(xctxt, sourceNode, this);