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

RE: Grouping / Count Issue

Subject: RE: Grouping / Count Issue
From: "Gabriel Osorio" <gosorio@xxxxxxxxxxx>
Date: Thu, 1 Dec 2005 09:55:40 -0500
gosorio last name
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:  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:  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

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.