Hi Richard.
you are calling templates which are not there!
<xsl:apply-templates select="/document/sql:rowset/sql:row/sql:generalmusictitle"/>


The example from Cocoon: building XML applications - with some comments:
sqlexample.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:sql="http://apache.org/cocoon/SQL/2.0";>
<!--the root of the the sqlexample is "document" but could also be "/" that is actually the same (HERE)-->
<!--MAIN - TEMPLATE-->
<xsl:template match="document">
<html>
<head><title>test</title></head>
<body><table>
<!--Here we call a SUB-TEMPLATE. The result of that template will be parsed right here. We are looking for the following XPath (sql:rowset/sql:row):
<sql:rowset>
<sql:row>This node</sql:row>
</sql:rowset>
-->
<xsl:apply-templates select="sql:rowset/sql:row"/>
</table></body></html>
</xsl:template>
<!--/MAIN - TEMPLATE-->
<!--Sub1 - TEMPLATE: apply all the templates which are based within the <sql:row>This node</sql:row>
Did you notice that we match the row output and parse a xhtml-element <tr> for each matching <sql:row/>.
Without using <xsl:for-each/>.
-->
<xsl:template match="sql:row">
<tr>
<xsl:apply-templates/>
</tr>
</xsl:template>
<!--/Sub1- TEMPLATE-->
<!--Sub2 - TEMPLATE-->
<!-- Here we know that the elements of the parent <sql:row/> are "sql:id|sql:name". | means or! Or lets say we just want them from the stream.-->
<xsl:template match="sql:id|sql:name">
<td>
<xsl:value-of select="."/>
</td>
</xsl:template>
<!--/Sub2 - TEMPLATE-->
</xsl:stylesheet>


Besides that it would be nice to see your sitemap.xmap and the result of the sql transformation of the database.xml <-Do you remember:
<map:pipeline>
<map:match pattern="database">
<map:generate src="database.xml"/>
<map:transform type="sql"/>
<!-- <map:transform src="databasepda.xsl"/>-->
<map:serialize/>
</map:match>
</map:pipeline>


King regards
Thorsten

Richard Cunliffe wrote:

Thorsten and Marco,

After reading the “Cocoon: Building XML Applications” and O’Reilly “XSLT” I have written my own “tidy and simple” XSL style sheet J (instead of using XML Spy). It’s giving results, but its not right.

I have included the style sheet, the XML document, and a picture of the results. I’m sure it’s nothing to serious. It may be something to do with X-Paths but I cant be sure.

Thanks,

Richard.

------------------------------------------------------------------------

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




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



Reply via email to