Subject: RE: [xsl] Slow XSLT From: Cleyton Jordan <cleytonjordan@xxxxxxxxxxx> Date: Thu, 13 Mar 2008 00:14:07 +0000 (GMT) |
Sorry, I will try again, For each Row in my xml I need to output a <tr>. So I apply templates. <xsl:variable name=set" select="Report/Rows//Row" /> ..... <xsl:apply-templates select="$set"/> ..... <xsl:template name="Row"> ...... <tr> <xsl:param name="set"/> <xsl:apply-templates select="$set[postion()]/*"/> </tr> <xsl:template> <xsl:template name="Cell"> When test Msr for each Msr <td> <xsl:value-of select="@val" /> </td> Otherwise For each Measure <td> </td> <xsl:template> In the Row template I apply templates again but this time I use the /* to get the child elements (Cell). However, if I do this - <xsl:apply-templates select="$set/*"/> - I will apply templates to all the Cell elements. So I will have only one <tr> with lots of <td>s. Something like that: <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> However, the output I need according to my xml below is this: <tr> <td>10</td> <td>15</td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td>45</td> <td>34</td> <td>123</td> <td>19</td> </tr> XML <Report xmlns=""> <Measures> <Measure idx="1" heading="Total Pages" /> <Measure idx="2" heading="Cost" /> </Measures> <Rows> <RowGrp> <Row heading="Name 1"> <Cell> <Msr idx="1" val="10" /> <Msr idx="2" val="15" /> </Cell> <Cell/> <Row heading="Name 2"> <Cell /> <Cell> <Msr idx="1" val="45" /> <Msr idx="2" val="34" /> <Cell/> <Cell> <Msr idx="1" val="123" /> <Msr idx="2" val="19" /> <Cell/> </Row> </RowGrp> </Rows> </Report> --- Michael Kay <mike@xxxxxxxxxxxx> wrote: > > > > It is like if I was using [1], [2] to get the > current Row > > (Row[1], Row[2]) but the '.' does not work with > the node set $set > > > > Is that clearer? > > No, I'm sorry, it isn't. Either you want to process > the current row, or you > want to process the rows in $set - you keep talking > about the "current" Row, > and then saying you don't want the current Row, you > want a row in $set. You > can do either, but you seem to be confused about > which you want. > > Michael Kay > http://www.saxonica.com/ > > __________________________________________________________ Sent from Yahoo! Mail. The World's Favourite Email http://uk.docs.yahoo.com/nowyoucan.html
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Slow XSLT, Michael Kay | Thread | Re: [xsl] Slow XSLT, David Carlisle |
RE: [xsl] Slow XSLT, Michael Kay | Date | Re: [xsl] Slow XSLT, Cleyton Jordan |
Month |