-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 20 Feb 2006, Martin Brüggebors wrote:

Date: Mon, 20 Feb 2006 23:35:39 +0100
From: "Martin [iso-8859-15] Brüggebors" <[EMAIL PROTECTED]>
Reply-To: users@cocoon.apache.org
To: users@cocoon.apache.org
Subject: Stylesheet to match rowset

I'm new to cocoon (and XSL-transformatons), so please excuse my beginner's
question:

I have a rowset from a sql-query:

<?xml version="1.0" encoding="ISO-8859-1"?>
<page xmlns:sql="http://apache.org/cocoon/SQL/2.0";>

<rowset xmlns="http://apache.org/cocoon/SQL/2.0";>
        <row>
                <k_num>50132</k_num>
                <k_kurz>Amt fuer Bla</k_kurz>
                <k_plzort>25464 Rellingen</k_plzort>
        </row>
        <row>
                <k_num>50133</k_num>
                <k_kurz>Leid</k_kurz>
                <k_plzort>91710 Gunzenhausen</k_plzort>
        </row>
</rowset>
</page>

and I'm trying to convert this into a simple html-table:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"

Add xmlns:sql="http://apache.org/cocoon/SQL/2.0"; to element xsl:stylesheet above.

xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="page">
        <html xmlns="http://www.w3.org/1999/xhtml";>
                <head>
                        <title>rs-test</title>
                </head>
                <body>
                        <table>
                                <xsl:for-each select="rowset/row" >
                                <tr>
                                        <td><xsl:value-of select="k_num"/></td>
                                        <td><xsl:value-of select="k_kurz"/></td>
                                        <td><xsl:value-of 
select="k_plzort"/></td>

and now you should use

      <td><xsl:value-of select="sql:k_num"/></td>
      <td><xsl:value-of select="sql:k_kurz"/></td>
      <td><xsl:value-of select="sql:k_plzort"/></td>

instead

HTH

                                </tr>
                                </xsl:for-each>
                        </table>
                </body>
        </html>
        </xsl:template>
</xsl:stylesheet>

This only works, when I delete the xmlns="http://apache.org/cocoon/SQL/2.0";
at the beginning of the rowset. In real-life I cannot delete this, because the
sql-transformer builds the rowset in my pipeline.

Which template will match the rowset with the namespace-attribute?

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



- -- Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (GNU/Linux)

iD8DBQFD+k0vLNdJvZjjVZARAtUqAKCl73dSWes3QqqprdK08/0e6tiztACeNNcB
sERh+t2GFnv5s9t+BE2m4GQ=
=BCe5
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to