DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
/** * 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 nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); // // We should probably make a function on the iterator for this, // // as a given implementation could optimize. // int i = 0; // // while (DTM.NULL != nl.nextNode()) // { // i++; // } // nl.detach(); DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); int i = nl.getLength(); nl.detach(); return new XNumber((double) i); } }
/** * 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 nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); // // We should probably make a function on the iterator for this, // // as a given implementation could optimize. // int i = 0; // // while (DTM.NULL != nl.nextNode()) // { // i++; // } // nl.detach(); DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode()); int i = nl.getLength(); nl.detach(); return new XNumber((double) i); } }
/** * 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); } }
/** * 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; }
DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode);
DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode);
DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); VariableStack vars = xctxt.getVarStack(); int nParams = getParamElemCount();
DTMIterator sourceNodes = m_selectExpression.asIterator(xctxt, sourceNode); VariableStack vars = xctxt.getVarStack(); int nParams = getParamElemCount();
/** * 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); } }
/** * 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); } }