471,330 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

help - i have a question with xsl

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 </trpart not having the initial tag.
How do i do this?

Thank you very much in advance,

Julie.

Jun 27 '08 #1
3 817
"Julie Smith" <ju***@home.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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 </trpart 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.
--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #2
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?
"Anthony Jones" <An*@yadayadayada.comwrote in message
news:eD**************@TK2MSFTNGP03.phx.gbl...
"Julie Smith" <ju***@home.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>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 </trpart 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.
--
Anthony Jones - MVP ASP/ASP.NET

Jun 27 '08 #3

"Julie Smith" <ju***@home.comwrote in message
news:O2**************@TK2MSFTNGP03.phx.gbl...
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.

--
Anthony Jones - MVP ASP/ASP.NET
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sunaina | last post: by
2 posts views Thread by A. Wiebenga | last post: by
13 posts views Thread by Chua Wen Ching | last post: by
28 posts views Thread by Siv | last post: by
5 posts views Thread by Patrick.O.Ige | last post: by
reply views Thread by Mike Collins | last post: by
3 posts views Thread by Perry Langla | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.