xsl-list
[Top] [All Lists]

RE: [xsl] Pivot Reports

2007-01-05 08:39:54
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(_at_)onebox(_dot_)com - email



-----Original Message-----
From:     Vitaliy Paykov <vpay(_at_)isd(_dot_)dp(_dot_)ua>
Sent:     Fri, 05 Jan 2007 12:15:48 +0200
To:       xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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(_at_)isd(_dot_)dp(_dot_)ua
ext: 1120
ICQ: 220022522
*/ISD QA/*

--~------------------------------------------------------------------
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>