public DTMXRTreeFrag(int dtmIdentity, XPathContext xctxt){ m_xctxt = xctxt; m_dtmIdentity = dtmIdentity; m_dtm = xctxt.getDTM(dtmIdentity); }
private final void initDTM(int root, XPathContext xctxt){ m_dtmRoot = root; final DTM dtm = xctxt.getDTM(root); if(dtm != null){ m_DTMXRTreeFrag = xctxt.getDTMXRTreeFrag(xctxt.getDTMIdentity(dtm)); } }
/** * 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(); }
public DTMXRTreeFrag(int dtmIdentity, XPathContext xctxt){ m_xctxt = xctxt; m_dtmIdentity = dtmIdentity; m_dtm = xctxt.getDTM(dtmIdentity); }
private final void initDTM(int root, XPathContext xctxt){ m_dtmRoot = root; final DTM dtm = xctxt.getDTM(root); if(dtm != null){ m_DTMXRTreeFrag = xctxt.getDTMXRTreeFrag(xctxt.getDTMIdentity(dtm)); } }
/** * 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 an instance of a DTM that "owns" a node handle. Since a node * iterator may be passed without a DTMManager, this allows the * caller to easily get the DTM using just the iterator. * * @param nodeHandle the nodeHandle. * * @return a non-null DTM reference. */ public DTM getDTM(int nodeHandle) { // %OPT% return m_execContext.getDTM(nodeHandle); }
/** * Get the current context node. * @return The current context node. */ public org.w3c.dom.Node getContextNode() { int context = getCurrentNode(); return getDTM(context).getNode(context); }
/** * Get the DTM for this walker. * * @return Non-null reference to a DTM. */ public DTM getDTM(int node) { // return wi().getXPathContext().getDTM(node); }
/** * Perform a pre-order traversal non-recursive style. * * @param pos Start node for traversal * * @throws TransformerException */ public void traverse(int pos) throws org.xml.sax.SAXException { m_dtm = m_transformer.getXPathContext().getDTM(pos); m_startNode = pos; super.traverse(pos); }
/** * Get the DTM for this walker. * * @return Non-null reference to a DTM. */ public DTM getDTM(int node) { // return wi().getXPathContext().getDTM(node); }
/** * Get the DOM Node of the current XPath context, which is possibly null. * @param sourceNode the handle on the node used by a DTM. */ private Node getDOMNodeFromDTM(int sourceNode) { org.apache.xml.dtm.DTM dtm = m_transformer.getXPathContext().getDTM(sourceNode); final Node source = (dtm == null) ? null : dtm.getNode(sourceNode); return source; } }
/** * Get the current context node. * @return The current context node. */ public org.w3c.dom.Node getContextNode() { int context = getCurrentNode(); return getDTM(context).getNode(context); }
/** * Perform a pre-order traversal non-recursive style. * * @param pos Start node for traversal * * @throws TransformerException */ public void traverse(int pos) throws org.xml.sax.SAXException { m_dtm = m_transformer.getXPathContext().getDTM(pos); m_startNode = pos; super.traverse(pos); }
/** * Return the first node out of the nodeset, if this expression is * a nodeset expression. This is the default implementation for * nodesets. * <p>WARNING: Do not mutate this class from this function!</p> * @param xctxt The XPath runtime context. * @return the first node out of the nodeset, or DTM.NULL. */ public int asNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { int current = xctxt.getCurrentNode(); DTM dtm = xctxt.getDTM(current); return dtm.getFirstChild(current); }
/** * @see org.apache.xalan.transformer.TransformState#getMatchedNode() */ public Node getMatchedNode() { if (m_elemPending) { DTM dtm = m_transformer.getXPathContext().getDTM(m_matchedNode); return dtm.getNode(m_matchedNode); } else { DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getMatchedNode()); return dtm.getNode(m_transformer.getMatchedNode()); } }
/** * @see org.apache.xalan.transformer.TransformState#getMatchedNode() */ public Node getMatchedNode() { if (m_elemPending) { DTM dtm = m_transformer.getXPathContext().getDTM(m_matchedNode); return dtm.getNode(m_matchedNode); } else { DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getMatchedNode()); return dtm.getNode(m_transformer.getMatchedNode()); } }
/** * @see org.apache.xalan.transformer.TransformState#getCurrentNode() */ public Node getCurrentNode() { if (m_currentNode != null) { return m_currentNode; } else { DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getCurrentNode()); return dtm.getNode(m_transformer.getCurrentNode()); } }
/** * @see org.apache.xalan.transformer.TransformState#getCurrentNode() */ public Node getCurrentNode() { if (m_currentNode != null) { return m_currentNode; } else { DTM dtm = m_transformer.getXPathContext().getDTM(m_transformer.getCurrentNode()); return dtm.getNode(m_transformer.getCurrentNode()); } }