/** * 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); }
/** * 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); }
/** * Create a NodeSetDTM, and copy the members of the * given DTMIterator into it. * */ public NodeSetDTM(NodeList nodeList, XPathContext xctxt) { super(); m_manager = xctxt.getDTMManager(); int n = nodeList.getLength(); for (int i = 0; i < n; i++) { Node node = nodeList.item(i); int handle = xctxt.getDTMHandleFromNode(node); // Do not reorder or strip duplicate nodes from the given DOM nodelist addNode(handle); // addNodeInDocOrder(handle, xctxt); } }
/** * Create a NodeSetDTM, and copy the members of the * given DTMIterator into it. * */ public NodeSetDTM(NodeList nodeList, XPathContext xctxt) { super(); m_manager = xctxt.getDTMManager(); int n = nodeList.getLength(); for (int i = 0; i < n; i++) { Node node = nodeList.item(i); int handle = xctxt.getDTMHandleFromNode(node); // Do not reorder or strip duplicate nodes from the given DOM nodelist addNode(handle); // addNodeInDocOrder(handle, xctxt); } }
/** * Get the value of a node as a number. * @param n Node to be converted to a number. May be null. * @return value of n as a number. */ public double toNumber(org.w3c.dom.Node n) { // %REVIEW% You can't get much uglier than this... int nodeHandle = getDTMHandleFromNode(n); DTM dtm = getDTM(nodeHandle); XString xobj = (XString)dtm.getStringValue(nodeHandle); return xobj.num(); }
/** * Get the value of a node as a string. * @param n Node to be converted to a string. May be null. * @return value of n as a string, or an empty string if n is null. */ public String toString(org.w3c.dom.Node n) { // %REVIEW% You can't get much uglier than this... int nodeHandle = getDTMHandleFromNode(n); DTM dtm = getDTM(nodeHandle); XMLString strVal = dtm.getStringValue(nodeHandle); return strVal.toString(); }
/** * Get the value of a node as a number. * @param n Node to be converted to a number. May be null. * @return value of n as a number. */ public double toNumber(org.w3c.dom.Node n) { // %REVIEW% You can't get much uglier than this... int nodeHandle = getDTMHandleFromNode(n); DTM dtm = getDTM(nodeHandle); XString xobj = (XString)dtm.getStringValue(nodeHandle); return xobj.num(); }
/** * Get the value of a node as a string. * @param n Node to be converted to a string. May be null. * @return value of n as a string, or an empty string if n is null. */ public String toString(org.w3c.dom.Node n) { // %REVIEW% You can't get much uglier than this... int nodeHandle = getDTMHandleFromNode(n); DTM dtm = getDTM(nodeHandle); XMLString strVal = dtm.getStringValue(nodeHandle); return strVal.toString(); }
/** * Create a NodeSetDTM, and copy the members of the * given DTMIterator into it. * * @param iterator Iterator which yields Nodes to be made members of the new set. */ public NodeSetDTM(NodeIterator iterator, XPathContext xctxt) { super(); Node node; m_manager = xctxt.getDTMManager(); while (null != (node = iterator.nextNode())) { int handle = xctxt.getDTMHandleFromNode(node); addNodeInDocOrder(handle, xctxt); } }
/** * Create a NodeSetDTM, and copy the members of the * given DTMIterator into it. * * @param iterator Iterator which yields Nodes to be made members of the new set. */ public NodeSetDTM(NodeIterator iterator, XPathContext xctxt) { super(); Node node; m_manager = xctxt.getDTMManager(); while (null != (node = iterator.nextNode())) { int handle = xctxt.getDTMHandleFromNode(node); addNodeInDocOrder(handle, xctxt); } }
/** * Return the value of the attribute interpreted as an Attribute * Value Template (in other words, you can use curly expressions * such as href="http://{website}". * * @param rawName Raw name of the attribute to get * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>. * @param transformer non-null reference to the the current transform-time state. * * @return the value of the attribute * * @throws TransformerException */ public String getAttribute( String rawName, org.w3c.dom.Node sourceNode, TransformerImpl transformer) throws TransformerException { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt) && avt.getRawName().equals(rawName)) { XPathContext xctxt = transformer.getXPathContext(); return avt.evaluate(xctxt, xctxt.getDTMHandleFromNode(sourceNode), this); } return null; }
/** * Return the value of the attribute interpreted as an Attribute * Value Template (in other words, you can use curly expressions * such as href="http://{website}". * * @param rawName Raw name of the attribute to get * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>. * @param transformer non-null reference to the the current transform-time state. * * @return the value of the attribute * * @throws TransformerException */ public String getAttribute( String rawName, org.w3c.dom.Node sourceNode, TransformerImpl transformer) throws TransformerException { AVT avt = getLiteralResultAttribute(rawName); if ((null != avt) && avt.getRawName().equals(rawName)) { XPathContext xctxt = transformer.getXPathContext(); return avt.evaluate(xctxt, xctxt.getDTMHandleFromNode(sourceNode), this); } return null; }
int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode); int ctxtNode = xpathSupport.getDTMHandleFromNode(contextNode);
xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler);
int xt = xctxt.getDTMHandleFromNode(context.getContextNode());
xctxt.pushCurrentNode(xctxt.getDTMHandleFromNode(context)); executeChildTemplates(elem, handler);
xpathSupport.getDTMHandleFromNode(m_doc);
try { 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) {
int handle = xctxt.getDTMHandleFromNode((DocumentFragment)obj); new XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node) obj), xctxt.getDTMManager());
int xpathOwnerNodeDTM = xctxt.getDTMHandleFromNode(xpathOwnerNode);