You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Riegel <do...@telig.net> on 2003/02/04 20:18:54 UTC

Strange results: SQL Transformer -> Other Transformer -> XML-Serializer

Hi,

for sure I do somthing wrong, because nobody seems to report similar 
problems. But I just can't find the error.

I would like to transform SQL Transformer output to another XML using 
the Identity Transformation (I guess this is the right word).

Problem: the attributes in the rowset-element are substituted by their 
value. Very strange:

Sitemap:

<map:match pattern="docbase/catalogue/topseller/**">
   <map:generate src="docbase/catalogue/topseller/{1}.xml" />
   <map:transform type="sql">
     <map:parameter name="use-connection" value="ProductConnection"/>
     <map:parameter name="show-nr-of-rows" value="true"/>
   </map:transform>
<!-- This is the problematic transformation -->
   <map:transform src="docbase/catalogue/topseller/{1}.xsl" />
   <map:serialize type="xml" />
</map:match>

Output without the problematic transformation:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<root test="abcabcabc"
   xmlns:topseller="http://software-express.de/catalogue/topseller/1.0">
   <title mehr="bbbb">Katalog - Topseller</title>
   <paragraph>Topseller-Liste</paragraph>
- <topseller:catalogue-page nochwas="hallöö">
<!-- The rowset-element and attributes looks fine -->
- <rowset nrofrows="2" name="abc">
- <row>
   <abc>A</abc>
   </row>
- <row>
   <abc>C</abc>
   </row>
   </rowset>
- <rowset nrofrows="2" name="manufacturer">
- <row>
   <manufacturer>Maxon</manufacturer>
   </row>
- <row>
   <manufacturer>McAfee</manufacturer>
   </row>
   </rowset>
   </topseller:catalogue-page>
   </root>


Wrong output _with_ the problematic transformation:

<?xml version="1.0" encoding="ISO-8859-1"?>
<root 
xmlns:topseller="http://software-express.de/catalogue/topseller/1.0" 
test="abcabcabc">
   <title mehr="bbbb">Katalog - Topseller</title>
   <paragraph>Topseller-Liste</paragraph>
   <topseller:catalogue-page nochwas="hallöö">
<!-- All test attributes above have been copied correctly -->

<!-- But what is that below? the rowset-attribute names have been 
substituted by the values??? That is no XML anymore. -->
   <rowset xmlns="http://apache.org/cocoon/SQL/2.0" 2="2" 
abc="abc"><row><abc>A</abc></row><row><abc>C</abc></row></rowset>


  <rowset xmlns="http://apache.org/cocoon/SQL/2.0" 2="2" 
manufacturer="manufacturer"><row><manufacturer>Maxon</manufacturer></row><row><manufacturer>McAfee</manufacturer></row></rowset>
</topseller:catalogue-page>
</root>

The problematic transformer xsl looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sql="http://apache.org/cocoon/SQL/2.0"
xmlns:topseller="http://software-express.de/catalogue/topseller/1.0">

<xsl:template match="/">
     <xsl:apply-templates />
</xsl:template>

<!-- Copy all unknown tags -->
<xsl:template match="@*|node()">
     <xsl:copy>
         <xsl:apply-templates select="@*|node()" />
     </xsl:copy>
</xsl:template>

</xsl:stylesheet>


Any idea what I'am doing wrong?

Regards
Stefan


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>