Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Grouping / Count Issue

From: "Gabriel Osorio" <gosorio@----------->
To:
Date: 12/1/2005 2:56:00 PM
This formula:

Put Record fields on a string variable separated by commas.
Then, with a loop, call recursive template.
Get first element and the rest.


This example works fine for my own last troubles:

<xsl:template match="Report">
<xsl:variable name="fieldNames">
   ,<xsl:for-each select="GrandTotal/RecordValues/Record/FieldValue">
	<xsl:value-of select="@fieldName"/>,
   </xsl:for-each>x
</xsl:variable>

<xsl:for-each select="Layout/Field[@dataType = 'F']">
	<xsl:call-template name="split">
		<xsl:with-param name="fields" select="$fieldNames"/>
	</xsl:call-template>
</xsl:for-each>

<!--Logic for Field[not(@dataType = 'F')]-->
</xsl:template>


<xsl:template name="split">
  <xsl:param name="fields"/>
  <xsl:variable name="head" select="substring-before($fields,',')"/>
  <xsl:variable name="tail" select="substring-after($fields,',')"/>

  <xsl:if test='$head'> 
		...
  </xsl:if>

  <xsl:if test='$tail'>
	<xsl:call-template name="split">
		<xsl:with-param name="fields" select="$tail"/>
	</xsl:call-template>
  </xsl:if>
</xsl:template>


Gabriel


-----Original Message-----
From: Miraodb [mailto:miraodb@xxxxxxxxxxx] 
Sent: Thursday, December 01, 2005 8:52 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Grouping / Count Issue

> Grouping / Count Issue
> 22986 by: Miraodb
> 22987 by: Gabriel Osorio

> Date: Mon, 28 Nov 2005 11:02:07 -0500
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> From: "Gabriel Osorio" <gosorio@xxxxxxxxxxx>
> Subject: RE: [xsl] Grouping / Count Issue
> Message-ID: <EXCHANGEaeJnKWiQsEH000018fd@xxxxxxxxxxxxxxxxxxxx>
>
> Maybe with:
>
> <!-- F Fields -->
> <xsl:apply-templates select="Field[@dataType = 'F']" />
> <!-- other -->
> <xsl:apply-templates select="Field[not(@dataType = 'F')]" />
>


Hi,

unfortunetely it's not so easy.
the datatype is only referenced in the layout.
so basically, i need to loop into all <fieldValue> elements and look for its
corresponding layout to check if it's a 'F' or 'V'....

It seems like a  slow process, i'm sure it can be done faster than that
using recursion but i can't make it yet.

thanks in advance for your help.
fabrice


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent