xsl-list
[Top] [All Lists]

Re: [xsl] Help XSL Transformation of Data

2009-09-28 13:32:40
Rajesh Jain wrote:

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

Is there any reason that you have version="1.1"?

<!-- ================================================================== -->
<!-- ==== G L O B A L   P A R A M E T E R S =========================== -->
<!-- ================================================================== -->

<xsl:param name="skin.images" />
<xsl:param name="webapp" />


<!-- ================================================================== -->
<!-- ==== TEMPLATE: chart-data-xml ==================================== -->
<!-- ================================================================== -->
<xsl:template name="chart-data-xml">


  <xsl:variable name="color">
    <xsl:choose>
     <xsl:when test="/page/HttpRequest/Parameters/@Color!=''"><xsl:value-of 
select="/page/HttpRequest/Parameters/@Color"/></xsl:when>
     <xsl:otherwise>5555ff</xsl:otherwise>
    </xsl:choose>
   </xsl:variable>

  <xsl:variable name="skip" 
select="count(Chart-Data/Root/Item[position()=1]/Statistics/Item) div 4"/>
  <xsl:variable name="chartids">
    <xsl:for-each select="Chart-Data/Root/Item">
      <xsl:value-of select="@ID"/><xsl:text>,</xsl:text>
    </xsl:for-each>
  </xsl:variable>



  <!-- ================================================================== -->
  <!-- Chart Data ======================================================= -->
  <!-- ================================================================== -->
    <xsl:output indent="yes"/>

xsl:output has to be a top level element (child of xsl:stylesheet).

<xsl:apply-templates select="Chart-Data"/>
  <xsl:key name="k1" match="Metrics/*" use="local-name()"/>

xsl:key has to be a top level element as well.


  <xsl:template match="Chart-Data">

You can't nest templates so you need to move this xsl:template out of the outer xsl:template.




--

        Martin Honnen
        http://msmvps.com/blogs/martin_honnen/

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