Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Pivot Reports

From: cknell@----------
To:
Date: 1/5/2007 3:40:00 PM
You will want a set of templates for each table. Each set of templates will match the same elements, but will be distinguished by using the "mode" attribute.

This is a very high-level sketch of the solution. You will have to fill in the details yourself.

Look into the "mode" attribute. Here are some links.

http://www.w3.org/TR/xslt#modes
http://www.w3schools.com/xsl/el_apply-templates.asp

<xsl:template match="/">
  <xsl:apply-templates mode="pivot1" />
  <xsl:apply-templates mode="pivot2" />
  <xsl:apply-templates mode="pivot3" />
  <xsl:apply-templates mode="pivot4" />
</xsl:template>


<xsl:template match="notice" mode="pivot1">

</xsl:template>

<xsl:template match="notice" mode="pivot2">

</xsl:template>

<xsl:template match="notice" mode="pivot3">

</xsl:template>

<xsl:template match="notice" mode="pivot4">

</xsl:template>
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Vitaliy Paykov <vpay@xxxxxxxxx>
Sent:     Fri, 05 Jan 2007 12:15:48 +0200
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  [xsl] Pivot Reports

  Hello all!
I need xsl template for crosstab building.

But not for one table, i need several crosstabs in one xsl template.

My XML:

<?xml version="1.0" encoding="iso-8859-1"?>
<notice>
<records>
<record>
<row>
   <pivot1>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>1.0.0.5</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.3.5</pivotcol>
<TOTALS>22</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.3.x</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.4.0</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.5.0</pivotcol>
<TOTALS>7</TOTALS>
</item>

........

</pivot1>

<pivot2>

<item>
<pivotrow>Critical</pivotrow>
<pivotcol>4.0.3.5</pivotcol>
<TOTALS>3</TOTALS>
</item>

<item>
<pivotrow>Non Critical</pivotrow>
<pivotcol>1.0.0.5</pivotcol>
<TOTALS>3</TOTALS>
</item>

<item>
<pivotrow>Non Critical</pivotrow>
<pivotcol>4.0.0.0</pivotcol>
<TOTALS>1</TOTALS>
</item>

.......

</pivot2>
   
</row>

<row>
 
  <pivot1>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>1.0.0.5</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.3.5</pivotcol>
<TOTALS>22</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.3.x</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.4.0</pivotcol>
<TOTALS>1</TOTALS>
</item>

<item>
<pivotrow>Closed</pivotrow>
<pivotcol>4.0.5.0</pivotcol>
<TOTALS>7</TOTALS>
</item>

........

</pivot1>

<pivot2>

<item>
<pivotrow>Critical</pivotrow>
<pivotcol>4.0.3.5</pivotcol>
<TOTALS>3</TOTALS>
</item>

<item>
<pivotrow>Non Critical</pivotrow>
<pivotcol>1.0.0.5</pivotcol>
<TOTALS>3</TOTALS>
</item>

<item>
<pivotrow>Non Critical</pivotrow>
<pivotcol>4.0.0.0</pivotcol>
<TOTALS>1</TOTALS>
</item>

.......

</pivot2>

</row>
</record></records></notice>

So for each <ROW> i must build 2 pivot reports.

How can i do it?

*/
/*
-- 
*/Best regards,
Vitaliy Paykov/*
e-mail: vpay@xxxxxxxxx
ext: 1120
ICQ: 220022522
*/ISD QA/*


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