[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] dynamic grouping of tabular data; one or two transformations?


Subject: RE: [xsl] dynamic grouping of tabular data; one or two transformations?
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Sat, 24 Nov 2001 16:11:40 -0800 (PST)

I am integrating my "dynamic grouping"  stylesheets into Chris'
<msxsl> solution and I am finding two immediate problems.

Here is a fragment from the output of the first stylesheet:

  <?xml version="1.0" encoding="UTF-16"?>
  <?xml-stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"?>
  <xsl:key name="KeyA" match="row" use="A"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />
  <xsl:key name="KeyB" match="row" use="B"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />

Q1) I can't seem to specify the output encoding to UTF-8 or Windows-1252.
    It always shows up at UTF-16 despit my definition:

   <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

Q2) I am getting default namespaces raining down on all of my elements:

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 

    When the code to generate the keys has no such references to such
    an attribute:

<xsl:param name="GroupBy" select="'A B'"/>
...
<xsl:call-template name="GenKeys">
  <xsl:with-param name="GroupBy" select="$GroupBy"/>
</xsl:call-template> 
...
 <xsl:template name="GenKeys">
  <xsl:param name="GroupBy"/>
  <xsl:variable name="nlist" select="concat(normalize-space($GroupBy),' ')"/>
  <xsl:variable name="head" select="substring-before($nlist,' ')"/>
  <xsl:variable name="tail" select="substring-after($nlist,' ')"/> 
  <xsl:element name="xsl:key">
   <xsl:attribute name="name">Key<xsl:value-of select="$head"/></xsl:attribute>
   <xsl:attribute name="match">row</xsl:attribute>
   <xsl:attribute name="use"><xsl:value-of select="$head"/></xsl:attribute>
  </xsl:element>
  <xsl:if test="$tail">
   <xsl:call-template name="GenKeys">
    <xsl:with-param name="GroupBy" select="$tail"/>
   </xsl:call-template>
  </xsl:if>
 </xsl:template>

Any help would be appreciated.

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread