/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator( XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(contextNode, xctxt); return iter; }
/** * Build a keys table. * @param doc The owner document key. * @param nscontext The stylesheet's namespace context. * @param name The key name * @param keyDeclarations The stylesheet's xsl:key declarations. * * @throws javax.xml.transform.TransformerException */ public KeyTable( int doc, PrefixResolver nscontext, QName name, Vector keyDeclarations, XPathContext xctxt) throws javax.xml.transform.TransformerException { m_docKey = doc; m_keyDeclarations = keyDeclarations; KeyIterator ki = new KeyIterator(name, keyDeclarations); m_keyNodes = new XNodeSet(ki); m_keyNodes.allowDetachToRelease(false); m_keyNodes.setRoot(doc, xctxt); }
/** * Execute this iterator, meaning create a clone that can * store state, and initialize it for fast execution from * the current runtime state. When this is called, no actual * query from the current context node is performed. * * @param xctxt The XPath execution context. * * @return An XNodeSet reference that holds this iterator. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
/** * Execute this iterator, meaning create a clone that can * store state, and initialize it for fast execution from * the current runtime state. When this is called, no actual * query from the current context node is performed. * * @param xctxt The XPath execution context. * * @return An XNodeSet reference that holds this iterator. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { XNodeSet iter = new XNodeSet((LocPathIterator)m_clones.getInstance()); iter.setRoot(xctxt.getCurrentNode(), xctxt); return iter; }
/** * Build a keys table. * @param doc The owner document key. * @param nscontext The stylesheet's namespace context. * @param name The key name * @param keyDeclarations The stylesheet's xsl:key declarations. * * @throws javax.xml.transform.TransformerException */ public KeyTable( int doc, PrefixResolver nscontext, QName name, Vector keyDeclarations, XPathContext xctxt) throws javax.xml.transform.TransformerException { m_docKey = doc; m_keyDeclarations = keyDeclarations; KeyIterator ki = new KeyIterator(name, keyDeclarations); m_keyNodes = new XNodeSet(ki); m_keyNodes.allowDetachToRelease(false); m_keyNodes.setRoot(doc, xctxt); }
/** * Add an association between a ref and a node in the m_refsTable. * Requires that m_refsTable != null * @param xctxt XPath context * @param ref the value of the use clause of the current key for the given node * @param node the node to reference */ private void addValueInRefsTable(XPathContext xctxt, XMLString ref, int node) { XNodeSet nodes = (XNodeSet) m_refsTable.get(ref); if (nodes == null) { nodes = new XNodeSet(node, xctxt.getDTMManager()); nodes.nextNode(); m_refsTable.put(ref, nodes); } else { // Nodes are passed to this method in document order. Since we need to // suppress duplicates, we only need to check against the last entry // in each nodeset. We use nodes.nextNode after each entry so we can // easily compare node against the current node. if (nodes.getCurrentNode() != node) { nodes.mutableNodeset().addNode(node); nodes.nextNode(); } } } }
/** * Add an association between a ref and a node in the m_refsTable. * Requires that m_refsTable != null * @param xctxt XPath context * @param ref the value of the use clause of the current key for the given node * @param node the node to reference */ private void addValueInRefsTable(XPathContext xctxt, XMLString ref, int node) { XNodeSet nodes = (XNodeSet) m_refsTable.get(ref); if (nodes == null) { nodes = new XNodeSet(node, xctxt.getDTMManager()); nodes.nextNode(); m_refsTable.put(ref, nodes); } else { // Nodes are passed to this method in document order. Since we need to // suppress duplicates, we only need to check against the last entry // in each nodeset. We use nodes.nextNode after each entry so we can // easily compare node against the current node. if (nodes.getCurrentNode() != node) { nodes.mutableNodeset().addNode(node); nodes.nextNode(); } } } }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { SubContextList subContextList = xctxt.getCurrentNodeList(); int currentNode = DTM.NULL; if (null != subContextList) { if (subContextList instanceof PredicatedNodeTest) { LocPathIterator iter = ((PredicatedNodeTest)subContextList) .getLocPathIterator(); currentNode = iter.getCurrentContextNode(); } else if(subContextList instanceof StepPattern) { throw new RuntimeException(XSLMessages.createMessage( XSLTErrorResources.ER_PROCESSOR_ERROR,null)); } } else { // not predicate => ContextNode == CurrentNode currentNode = xctxt.getContextNode(); } return new XNodeSet(currentNode, xctxt.getDTMManager()); }
return new XNodeSet(xctxt.getDTMManager());
result = new XNodeSet(xctxt.getDTMManager());
result = new XNodeSet(xctxt.getDTMManager());
upi.setRoot(current, xctxt); nodes = new XNodeSet(upi);
XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM nodeSet = nodes.mutableNodeset();
upi.setRoot(current, xctxt); nodes = new XNodeSet(upi);
XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM nodeSet = nodes.mutableNodeset();
XNodeSet nodes = new XNodeSet(xctxt.getDTMManager()); NodeSetDTM nodeSet = nodes.mutableNodeset();