|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Why doesn't <xsl:for-each select="*[position()<last
I am unable to get an example to work from a tutorial I grabbed and I do not know why. The troubling line is "<xsl:for-each select="*[position()<last()]">". I am using Cocoon2 to translate the code and the output is set to HTML, which is why I substituted the Hex codes with "<br />". Would you know why I am having problems? ********************************** Stylesheet ************************* <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:variable name="delimiter" select='"/"'/> <xsl:template match="FitnessCenter"> <xsl:for-each select="Member"> <xsl:apply-templates select="."/> <br/> <!--- I had to change this from 
 because the hex codes are not recognized --> </xsl:for-each> </xsl:template> <xsl:template match="Member"> <xsl:for-each select="*[position()<last()]"> <xsl:value-of select="."/> <xsl:value-of select="$delimiter"/> </xsl:for-each> </xsl:value-of select="*[last()]"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> ******************************************* XML Document ************************ <?xml version="1.0" ?> <FitnessCenter> <Member id="1" level="platinum"> <Name>Jeff</Name> <Phone type="home">555-1234</Phone> <Phone type="work">555-4321</Phone> <FavoriteColor>lightgrey</FavoriteColor> </Member> <Member id="2" level="platinum"> <Name>David</Name> <Phone type="home">383-1234</Phone> <Phone type="work">383-4321</Phone> <FavoriteColor>lightblue</FavoriteColor> </Member> <Member id="3" level="platinum"> <Name>Roger</Name> <Phone type="home">888-1234</Phone> <Phone type="work">888-4321</Phone> <FavoriteColor>lightyellow</FavoriteColor> </Member> </FitnessCenter> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








