|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: following-sibling in for-each
David,
> This doesn't address the following-sibling ordering problem, and
> isn't very elegant, but I think it does what you want:
Not very elegant is one way of putting it. Completely contrary to the
processing model of XSLT is another :)
If you give people solutions using disable-output-escaping, you should
at least give them the warning that (a) they'll generate
non-well-formed XML/HTML if they're not very careful and (b)
processors are not required to support disable-output-escaping.
Having said that, it is true that the alternative that doesn't use
extensions or disable-output-escaping is pretty horrible:
<xsl:variable name="properties"
select="Property[starts-with(@SecurityType, '1')]" />
<table width="100%">
<xsl:for-each select="$properties">
<xsl:sort select="@TabOrder" data-type="number" />
<xsl:if test="position() mod 2 = 1">
<xsl:variable name="index" select="position()" />
<tr>
<td><xsl:value-of select="." /></td>
<td>
<xsl:for-each select="$properties">
<xsl:sort select="@TabOrder" data-type="number" />
<xsl:if test="position() = $index + 1">
<xsl:value-of select="." />
</xsl:if>
</xsl:for-each>
</td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








