xsl-list
[Top] [All Lists]

RE: Grouping / Count Issue

2005-12-01 07:55:40
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[(_at_)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(_at_)hotmail(_dot_)com] 
Sent: Thursday, December 01, 2005 8:52 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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(_at_)lists(_dot_)mulberrytech(_dot_)com>
From: "Gabriel Osorio" <gosorio(_at_)tournet(_dot_)com>
Subject: RE: [xsl] Grouping / Count Issue
Message-ID: 
<EXCHANGEaeJnKWiQsEH000018fd(_at_)Exchange(_dot_)tournet(_dot_)com>

Maybe with:

<!-- F Fields -->
<xsl:apply-templates select="Field[(_at_)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



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>