Subject: [xsl] Numbering Grouped Child Elements From: Jake Stevenson <Jake.Stevenson@xxxxxxxx> Date: Tue, 30 Jan 2001 15:45:29 -0600 |
I need to be able to output numbers based on groups of child elements. I have an XML file similar to the following: <Steps> <Data_Entry> <Field_Name>User</Field_Name> <General_Data>your user name</General_Data> </Data_Entry> <Data_Entry> <Field_Name>password</Field_Name> <General_Data>your password</General_Data> </Data_Entry> <Button_Click> <Button_Image>OK</Button_Image> </Button_Click> <Data_Entry> <Field_Name>Item Number</Field_Name> <Specific_Data>00023</Specific_Data> </Data_Entry> </Steps> I'm able to group the elements so that the output looks like this: Complete the following field(s): User Password Click OK. Complete the following field(s): Item Number I used the following XSLT to accomplish that: <xsl:for-each select="Steps/*"> <xsl:choose> <xsl:when test="name()='Data_Entry'"> <xsl:if test="position()=1"> <tr> <td><!--Number to go here--></td> <td colspan="2">Complete the following fields:</td> </tr> </xsl:if> <tr> <td></td> <td colspan="2"> <span class="Field_Name"><xsl:value-of select="Field_Name"/></span> </td> </tr> </xsl:when> <xsl:when test="name()='Button_Click'"> <tr> <td><!--Number to go here--></td> <td>Click <xsl:apply-templates select="Button_Image"/>.</td> </tr> </xsl:when> </xsl:choose> </xsl:for-each> Now, I need to number the groups so that the output looks like this: 1. Complete the following field(s): User Password 2. Click OK. 3. Complete the following field(s): Item Number Is this possible using <xsl:number/>? Or do I need to seek some other solution? Thank you. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] FOP: how do I get my content , Pouliot, Brian R. | Thread | Re: [xsl] Numbering Grouped Child E, Jeni Tennison |
RE: [xsl] dealing with doctype dtd', Michael Kay | Date | RE: [xsl] default parameters, Michael Kay |
Month |