/** * Get the target node that will be counted.. * * @param xctxt The XPath runtime state for this. * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>. * * @return the target node that will be counted * * @throws TransformerException */ public int getTargetNode(XPathContext xctxt, int sourceNode) throws TransformerException { int target = DTM.NULL; XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode); if (Constants.NUMBERLEVEL_ANY == m_level) { target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } else { target = findAncestor(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } return target; }
getMatchingAncestors(xctxt, sourceNode, Constants.NUMBERLEVEL_SINGLE == m_level); int lastIndex = ancestors.size() - 1; ? formatNumberList(transformer, list, sourceNode) : "";
/** * Execute an xsl:number instruction. The xsl:number element is * used to insert a formatted number into the result tree. * * @param transformer non-null reference to the the current transform-time state. * * @throws TransformerException */ public void execute( TransformerImpl transformer) throws TransformerException { int sourceNode = transformer.getXPathContext().getCurrentNode(); String countString = getCountString(transformer, sourceNode); try { transformer.getResultTreeHandler().characters(countString.toCharArray(), 0, countString.length()); } catch(SAXException se) { throw new TransformerException(se); } }
/** * Add a child to the child list. * * @param newChild Child to add to child list * * @return Child just added to child list * * @throws DOMException */ public ElemTemplateElement appendChild(ElemTemplateElement newChild) { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, formattedNumber); break; case 'a' : thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, stringBuf); formattedNumber.append( stringBuf.toString().toLowerCase( getLocale(transformer, contextNode))); formattedNumber.append(long2roman(listElement, true)); break; case 'i' : formattedNumber.append( long2roman(listElement, true).toLowerCase( getLocale(transformer, contextNode))); break; case 0x3042 : formattedNumber.append(tradAlphaCount(listElement, thisBundle));
XPath countMatchPattern = getCountMatchPattern(xctxt, node); DTM dtm = xctxt.getDTM(node);
Locale locale = (Locale)getLocale(transformer, contextNode).clone();
formattedNumber.append(lastSep); getFormattedNumber(transformer, contextNode, numberType, numberWidth, list[i], formattedNumber);
/** * Add a child to the child list. * * @param newChild Child to add to child list * * @return Child just added to child list * * @throws DOMException */ public ElemTemplateElement appendChild(ElemTemplateElement newChild) { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, formattedNumber); break; case 'a' : thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, stringBuf); formattedNumber.append( stringBuf.toString().toLowerCase( getLocale(transformer, contextNode))); formattedNumber.append(long2roman(listElement, true)); break; case 'i' : formattedNumber.append( long2roman(listElement, true).toLowerCase( getLocale(transformer, contextNode))); break; case 0x3042 : formattedNumber.append(tradAlphaCount(listElement, thisBundle));
/** * Add a child to the child list. * * @param newChild Child to add to child list * * @return Child just added to child list * * @throws DOMException */ public ElemTemplateElement appendChild(ElemTemplateElement newChild) { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
XPath countMatchPattern = getCountMatchPattern(xctxt, node); DTM dtm = xctxt.getDTM(node);
Locale locale = (Locale)getLocale(transformer, contextNode).clone();
formattedNumber.append(lastSep); getFormattedNumber(transformer, contextNode, numberType, numberWidth, list[i], formattedNumber);
/** * Add a child to the child list. * * @param newChild Child to add to child list * * @return Child just added to child list * * @throws DOMException */ public ElemTemplateElement appendChild(ElemTemplateElement newChild) { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, formattedNumber); break; case 'a' : thisBundle = (XResourceBundle) XResourceBundle.loadResourceBundle( org.apache.xml.utils.res.XResourceBundle.LANG_BUNDLE_NAME, getLocale(transformer, contextNode)); m_alphaCountTable = (CharArrayWrapper) thisBundle.getObject(org.apache.xml.utils.res.XResourceBundle.LANG_ALPHABET); int2alphaCount(listElement, m_alphaCountTable, stringBuf); formattedNumber.append( stringBuf.toString().toLowerCase( getLocale(transformer, contextNode))); formattedNumber.append(long2roman(listElement, true)); break; case 'i' : formattedNumber.append( long2roman(listElement, true).toLowerCase( getLocale(transformer, contextNode))); break; case 0x3042 : formattedNumber.append(tradAlphaCount(listElement, thisBundle));
/** * Get the target node that will be counted.. * * @param xctxt The XPath runtime state for this. * @param sourceNode non-null reference to the <a href="http://www.w3.org/TR/xslt#dt-current-node">current source node</a>. * * @return the target node that will be counted * * @throws TransformerException */ public int getTargetNode(XPathContext xctxt, int sourceNode) throws TransformerException { int target = DTM.NULL; XPath countMatchPattern = getCountMatchPattern(xctxt, sourceNode); if (Constants.NUMBERLEVEL_ANY == m_level) { target = findPrecedingOrAncestorOrSelf(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } else { target = findAncestor(xctxt, m_fromMatchPattern, countMatchPattern, sourceNode, this); } return target; }
getMatchingAncestors(xctxt, sourceNode, Constants.NUMBERLEVEL_SINGLE == m_level); int lastIndex = ancestors.size() - 1; ? formatNumberList(transformer, list, sourceNode) : "";
/** * Add a child to the child list. * * @param newChild Child to add to child list * * @return Child just added to child list * * @throws DOMException */ public ElemTemplateElement appendChild(ElemTemplateElement newChild) { error(XSLTErrorResources.ER_CANNOT_ADD, new Object[]{ newChild.getNodeName(), this.getNodeName() }); //"Can not add " +((ElemTemplateElement)newChild).m_elemName + //" to " + this.m_elemName); return null; }
XPath countMatchPattern = getCountMatchPattern(xctxt, pos); DTM dtm = xctxt.getDTM(pos);