cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jasha Joachimsthal" <j.joachimst...@hippo.nl>
Subject RE: XSLT table formatting problem
Date Wed, 06 Sep 2006 16:58:39 GMT
Do the rows and row tags have the same namespace as page and data? Maybe they are a result
of a SQL query and they have tje SQL namespace.
Just a wild guess...
 

Jasha Joachimsthal 

--------- 

Hippo 
Oosteinde 11 
1017 WT Amsterdam 
The Netherlands 
+31 (0)20 5224466 

jasha@hippo.nl 
www.hippo.nl 

-----Original Message-----
From: Manuel Ottaviano [mailto:cocoon@lst.tfo.upm.es]
Sent: woensdag 6 september 2006 18:28
To: users@cocoon.apache.org
Subject: XSLT table formatting problem


Hello cocoon users , I've a problem with a trasformation of an XML file.
This  is the XML file, generated by a pipeline process:

<page xmlns:xlink= "http://www.w3.org/1999/xlink" <http://www.w3.org/1999/xlink>
 xmlns:i18n= "http://apache.org/cocoon/i18n/2.1" <http://apache.org/cocoon/i18n/2.1>
 >
<program>program</program>
   <data>
    <product>Hearth Failure Management</product>
    <error_code>200</error_code>
    <command>List of Patient</command>
    <rows>
        <row>
            <status>Alert!</status>
            <surname>Rodriguez</surname>
            <name>Manuel</name>
            <chn>1234556789</chn>
            <age>60</age>
            <gender>F</gender>
            <lastSeen>lastSeen</lastSeen>
            <patientID>1563</patientID>
        </row>
        <row>
            ...
          .... [much more data....]
          .....
        </row>

    </rows>
</data>

</page>

I've created a test stylesheet to generate a table , like the following:

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

<xsl:template match="/page">
  <html>
  <body>
    <h2>List of Patient</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
      <th align="left">Status</th>
      <th align="left">Surname</th>
         </tr>
        <xsl:for-each select="/page/data/rows/row">
    <tr>
      <td><xsl:value-of select="status"/></td>
      <td><xsl:value-of select="surname"/></td>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>

</xsl:stylesheet>

If  I test with a browser or with XML-spy  I obtain a table, but if I insert the stylesheet
inside the pipeline, as a transformer  it doesn't work....... only can be seen  the table
header....

<html>
    <body>
<h2>List of Patient</h2>
   <table border="1">
 <tr bgcolor="#9acd32">
<th align="left">Status</th>
<th align="left">Surname</th>
</tr>
</table>
</body>
</html>




I'm a bit lost.... 

ANY suggestion??

thanks very much.

manuel ottaviano 



Mime
View raw message