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

Re: Another (positional?) grouping problem

Subject: Re: Another (positional?) grouping problem
From: Rudolf P. Weinmann <rudolf.weinmann@xxxxxxxxxxxx>
Date: Fri, 20 Oct 2006 13:32:52 +0200
Re:  Another (positional?) grouping problem
>The other way to achieve that would be to leave out the "except xxx", in
>which case the initial nodes would go in a group of their own, and you could
>eliminate that group with a test such as
>
><xsl:if test="current-group()[1][self::DATE]">
>

Michael, thanks again, this way I can avoid the use of preceding-sibling which
most probably results in a performance gain.
The stylesheet now looks as follows:

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/DOC">
    <Trx>
      <xsl:for-each-group select="*" group-starting-with="DATE">
        <xsl:if test="current-group()[1][self::DATE]">
          <Transaction>
            <xsl:apply-templates select="current-group()"/>
          </Transaction>
        </xsl:if>
      </xsl:for-each-group>
    </Trx>
  </xsl:template>

  <xsl:template match="DATE">
    <Date><xsl:value-of select="."/></Date>
  </xsl:template>

  <xsl:template match="VALUE_DATE">
    <ValueDate><xsl:value-of select="."/></ValueDate>
  </xsl:template>

  <xsl:template match="TEXT">
    <Text><xsl:value-of select="."/></Text>
  </xsl:template>

  <xsl:template match="AMOUNT">
    <Amount><xsl:value-of select="."/></Amount>
  </xsl:template>

  <xsl:template match="BALANCE_NEW">
    <NewBalance><xsl:value-of select="."/></NewBalance>
  </xsl:template>
</xsl:stylesheet>

Rudolf Weinmann

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.