help - i have a question with xsl

  • Thread starter Thread starter Julie Smith
  • Start date Start date
J

Julie Smith

I apologise in advance for asking here. I know its a C# newsgroup, but i
regard this newsgroup as one of the best to come to for dev help.

I want to do this in xsl:
<xsl:if test="true"></tr></xsl:if>

However, i get an error regarding the </tr> part not having the initial tag.
How do i do this?

Thank you very much in advance,

Julie.
 
Julie Smith said:
I apologise in advance for asking here. I know its a C# newsgroup, but i
regard this newsgroup as one of the best to come to for dev help.

I want to do this in xsl:
<xsl:if test="true"></tr></xsl:if>

However, i get an error regarding the </tr> part not having the initial tag.
How do i do this?

XSL is XML and therefore needs to be well formed. You can't conditionally
end an element in the way you are trying to. I notice you've now posted to
the m.p.xsl group which is the best group for this but I think you will need
to post more detail to get a solution.
 
I'm trying to iterate through a collection and list them in a table going
horizontally, not vertically.
Example of what i've currently got, but not working:

<xsl:variable name="columns" select="5"/>
<table>
<xsl:for-each select="//People">
<xsl:if test="(position() mod $columns) = 0"><tr></xsl:if>
<td>
<xsl:value-of select="@name"/>
</td>
<xsl:if test="(position() mod $columns) = 0"></tr></xsl:if>
</xsl:for-each>
</table>

Does that make sense?
 
Julie Smith said:
I'm trying to iterate through a collection and list them in a table going
horizontally, not vertically.
Example of what i've currently got, but not working:

<xsl:variable name="columns" select="5"/>
<table>
<xsl:for-each select="//People">
<xsl:if test="(position() mod $columns) = 0"><tr></xsl:if>
<td>
<xsl:value-of select="@name"/>
</td>
<xsl:if test="(position() mod $columns) = 0"></tr></xsl:if>
</xsl:for-each>
</table>

Does that make sense?


Yes and the ever present Martin Honnen has answered it in the xsl group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top