/** * Given a node handle, find the owning document node. Unlike the DOM, * this considers the owningDocument of a Document to be itself. * * @param nodeHandle the id of the node. * @return int Node handle of owning document, or the nodeHandle if it is * a Document. */ public int getDocumentRoot(int nodeHandle) { return getManager().getDTM(nodeHandle).getDocument(); }
/** * Given a node handle, find the owning document node. Unlike the DOM, * this considers the owningDocument of a Document to be itself. * * @param nodeHandle the id of the node. * @return int Node handle of owning document, or the nodeHandle if it is * a Document. */ public int getDocumentRoot(int nodeHandle) { return getManager().getDTM(nodeHandle).getDocument(); }
m_transformer.setSourceTreeDocForThread(m_dtm.getDocument());
m_transformer.setSourceTreeDocForThread(m_dtm.getDocument());
/** * Cast result object to a result tree fragment. * * @param support Xpath context to use for the conversion * * @return A document fragment with this string as a child node */ public int rtf(XPathContext support) { DTM frag = support.createDocumentFragment(); frag.appendTextChild(str()); return frag.getDocument(); }
/** * Cast result object to a result tree fragment. * * @param support Xpath context to use for the conversion * * @return A document fragment with this string as a child node */ public int rtf(XPathContext support) { DTM frag = support.createDocumentFragment(); frag.appendTextChild(str()); return frag.getDocument(); }
m_transformer.setSourceTreeDocForThread(m_dtm.getDocument()); m_transformer.run();
return dtm.getDocument();
/** * Cast result object to a result tree fragment. * * @param support XPath context to use for the conversion * * @return the objec as a result tree fragment. */ public int rtf(XPathContext support) { int result = rtf(); if (DTM.NULL == result) { DTM frag = support.createDocumentFragment(); // %OPT% frag.appendTextChild(str()); result = frag.getDocument(); } return result; }
/** * Cast result object to a result tree fragment. * * @param support XPath context to use for the conversion * * @return the objec as a result tree fragment. */ public DocumentFragment rtree(XPathContext support) { DocumentFragment docFrag = null; int result = rtf(); if (DTM.NULL == result) { DTM frag = support.createDocumentFragment(); // %OPT% frag.appendTextChild(str()); docFrag = (DocumentFragment)frag.getNode(frag.getDocument()); } else { DTM frag = support.getDTM(result); docFrag = (DocumentFragment)frag.getNode(frag.getDocument()); } return docFrag; }
return dtm.getDocument();
/** * Cast result object to a result tree fragment. * * @param support XPath context to use for the conversion * * @return the objec as a result tree fragment. */ public DocumentFragment rtree(XPathContext support) { DocumentFragment docFrag = null; int result = rtf(); if (DTM.NULL == result) { DTM frag = support.createDocumentFragment(); // %OPT% frag.appendTextChild(str()); docFrag = (DocumentFragment)frag.getNode(frag.getDocument()); } else { DTM frag = support.getDTM(result); docFrag = (DocumentFragment)frag.getNode(frag.getDocument()); } return docFrag; }
/** * Cast result object to a result tree fragment. * * @param support XPath context to use for the conversion * * @return the objec as a result tree fragment. */ public int rtf(XPathContext support) { int result = rtf(); if (DTM.NULL == result) { DTM frag = support.createDocumentFragment(); // %OPT% frag.appendTextChild(str()); result = frag.getDocument(); } return result; }
/** * Dereference the variable, and return the reference value. Note that lazy * evaluation will occur. If a variable within scope is not found, a warning * will be sent to the error listener, and an empty nodeset will be returned. * * * @param xctxt The runtime execution context. * * @return The evaluated variable, or an empty nodeset if not found. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK); DTMManager dtmMgr = xctxt.getDTMManager(); int context = xctxt.getContextNode(); if(dtmMgr.getDTM(xns.getRoot()).getDocument() != dtmMgr.getDTM(context).getDocument()) { Expression expr = (Expression)xns.getContainedIter(); xns = (XNodeSet)expr.asIterator(xctxt, context); } return xns; }
/** * Dereference the variable, and return the reference value. Note that lazy * evaluation will occur. If a variable within scope is not found, a warning * will be sent to the error listener, and an empty nodeset will be returned. * * * @param xctxt The runtime execution context. * * @return The evaluated variable, or an empty nodeset if not found. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt, boolean destructiveOK) throws javax.xml.transform.TransformerException { XNodeSet xns = (XNodeSet)super.execute(xctxt, destructiveOK); DTMManager dtmMgr = xctxt.getDTMManager(); int context = xctxt.getContextNode(); if(dtmMgr.getDTM(xns.getRoot()).getDocument() != dtmMgr.getDTM(context).getDocument()) { Expression expr = (Expression)xns.getContainedIter(); xns = (XNodeSet)expr.asIterator(xctxt, context); } return xns; }
/** * 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 { String name = m_arg0.execute(xctxt).str(); int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int doc = dtm.getDocument(); String uri = dtm.getUnparsedEntityURI(name); return new XString(uri); } }
/** * 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 { String name = m_arg0.execute(xctxt).str(); int context = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(context); int doc = dtm.getDocument(); String uri = dtm.getUnparsedEntityURI(name); return new XString(uri); } }
int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle);
int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle);
int docContext = dtm.getDocument();