[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: following-sibling in for-each

Subject: Re: [xsl] following-sibling in for-each
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 16 Nov 2001 16:01:47 +0000
xsl for each following
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.