/** * Cast result object to an XMLString. * * @return The document fragment node data or the empty string. */ public XMLString xstr() { if(null == m_xmlStr) m_xmlStr = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot); return m_xmlStr; }
/** * @return The string value of the node * * @throws DOMException */ public final String getStringValue() throws DOMException { return dtm.getStringValue(node).toString(); }
/** * @return The string value of the node * * @throws DOMException */ public final String getStringValue() throws DOMException { return dtm.getStringValue(node).toString(); }
/** * Cast result object to an XMLString. * * @return The document fragment node data or the empty string. */ public XMLString xstr() { if(null == m_xmlStr) m_xmlStr = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot); return m_xmlStr; }
/** * Get the string conversion from a single node. * * @param n Node to convert * * @return the string conversion from a single node. */ public XMLString getStringFromNode(int n) { // %OPT% // I guess we'll have to get a static instance of the DTM manager... if(DTM.NULL != n) { return m_dtmMgr.getDTM(n).getStringValue(n); } else { return org.apache.xpath.objects.XString.EMPTYSTRING; } }
/** * Get the string conversion from a single node. * * @param n Node to convert * * @return the string conversion from a single node. */ public XMLString getStringFromNode(int n) { // %OPT% // I guess we'll have to get a static instance of the DTM manager... if(DTM.NULL != n) { return m_dtmMgr.getDTM(n).getStringValue(n); } else { return org.apache.xpath.objects.XString.EMPTYSTRING; } }
/** * Get numeric value of the string conversion from a single node. * * @param n Node to convert * * @return numeric value of the string conversion from a single node. */ public double getNumberFromNode(int n) { XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n); return xstr.toDouble(); }
/** * Cast result object to a string. * * @return The document fragment node data or the empty string. */ public String str() { String str = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot).toString(); return (null == str) ? "" : str; }
/** * Get numeric value of the string conversion from a single node. * * @param n Node to convert * * @return numeric value of the string conversion from a single node. */ public double getNumberFromNode(int n) { XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n); return xstr.toDouble(); }
/** * Cast result object to a string. * * @return The document fragment node data or the empty string. */ public String str() { String str = m_DTMXRTreeFrag.getDTM().getStringValue(m_dtmRoot).toString(); return (null == str) ? "" : str; }
/** * 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(); }
/** * 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(); }
/** * Returns whether a namespace is defined * * * @param attr Namespace attribute node * @param dtm The DTM that owns attr. * * @return True if the namespace is already defined in * list of namespaces */ public static boolean isDefinedNSDecl( SerializationHandler serializer, int attr, DTM dtm) { if (DTM.NAMESPACE_NODE == dtm.getNodeType(attr)) { // String prefix = dtm.getPrefix(attr); String prefix = dtm.getNodeNameX(attr); String uri = serializer.getNamespaceURIFromPrefix(prefix); // String uri = getURI(prefix); if ((null != uri) && uri.equals(dtm.getStringValue(attr))) return true; } return false; }
/** * Returns whether a namespace is defined * * * @param attr Namespace attribute node * @param dtm The DTM that owns attr. * * @return True if the namespace is already defined in * list of namespaces */ public static boolean isDefinedNSDecl( SerializationHandler serializer, int attr, DTM dtm) { if (DTM.NAMESPACE_NODE == dtm.getNodeType(attr)) { // String prefix = dtm.getPrefix(attr); String prefix = dtm.getNodeNameX(attr); String uri = serializer.getNamespaceURIFromPrefix(prefix); // String uri = getURI(prefix); if ((null != uri) && uri.equals(dtm.getStringValue(attr))) return true; } return false; }
return dtm.getStringValue(currentNode);
XMLString str = dtm.getStringValue(currentNode); return str.toDouble();
/** * 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 { DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); double sum = 0.0; int pos; while (DTM.NULL != (pos = nodes.nextNode())) { DTM dtm = nodes.getDTM(pos); XMLString s = dtm.getStringValue(pos); if (null != s) sum += s.toDouble(); } nodes.detach(); return new XNumber(sum); } }
/** * 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 { DTMIterator nodes = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); double sum = 0.0; int pos; while (DTM.NULL != (pos = nodes.nextNode())) { DTM dtm = nodes.getDTM(pos); XMLString s = dtm.getStringValue(pos); if (null != s) sum += s.toDouble(); } nodes.detach(); return new XNumber(sum); } }