Subject: [xsl] Looping on a set value From: "Alex Dragowski" <ajdrag@xxxxxxxxxxx> Date: Sun, 23 Feb 2003 13:58:38 -0500 |
<stories> <StoryBody> <Priority>4</ Priority > <name>My name</name> <content>Some content</content> </ StoryBody > <StoryBody> <Priority>2</ Priority > <name>My name</name> <content>Some content</content> </ StoryBody > <StoryBody> < Priority >6</ Priority > <name>Your name</name> <content>Some content</content> </StoryBody> <StoryBody> < Priority >4</ Priority > <name>Her name</name> <content>Some content</content> </StoryBody> <StoryBody> < Priority >1</ Priority > <name>His name</name> <content>Some content</content> </StoryBody> <!-- More Content --> </stories>
<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="displayitems"> <xsl:param name="index" select="1"/> <xsl:for-each select="stories/StoryBody[Priority=$index]"> <tr> <td>
</td> </tr> </xsl:for-each>
<xsl:if test="$index < 3"> <xsl:call-template name="displayitems"> <xsl:with-param name="index" select="$index + 1"/> </xsl:call-template> </xsl:if> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Import stylesheets in Xalan a, Andrey Guskov | Thread | RE: [xsl] Looping on a set value, Michael Kay |
RE: [xsl] Unique local-name(), Michael Kay | Date | Re: [xsl] different first element i, Lorenzo De Tomasi |
Month |