[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sequential numbering temp trees
Hi I am a bit of newbie , I am trying to create a temp tree of nodes to then use to number output rows sequentially. How do I create a temp tree using my templates and then access the nodes of my temp tree? All attempts I have made seem to only result in a text string, and an error that my "expression must evaluate to a node set". Any examples would be a great help? Here is some code that demonstrates my problem. <?xml version="1.0"?> <xslt:stylesheet version="1.0" xmlns:xslt="http://www.w3.org/1999/XSL/Transform"> <xslt:output method="text" indent="no"/> <xslt:template match="Results"> <xslt:variable name="flattree"> <xslt:apply-templates mode="phase1"/> </xslt:variable> <!-- This works... --> <xslt:value-of select="."/> <!-- ...this doesn't: <xslt:for-each select="$flattree"> <xslt:value-of select="."/> </xslt:for-each> --> </xslt:template> <xslt:template match="*" mode="phase1"> <xslt:value-of select="'myrecord'"/> </xslt:template> </xslt:stylesheet> Thanks Charles ***************************************************************************** ****************** Did you know? Aligned Assets and Rochdale Metropolitan Borough Council have qualified as finalists in the IM 2004 awards! Find out more at http://www.aligned-assets.co.uk/aboutaa/im2004_awards.html
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|