thanks so far, but this did not solve the error. I also assume, the
former version might have worked correctly, as the 'b's appear ..
which could only happen, if the correct template was matched .. hm ..
did the correction anyway, but no chages...
more or less my problem is in displaying the content of essen_titel,
essen_beschreibung and essen_preis of the elements a layer deeper ..
See in code:
Hi everybody,
I am creating a cocoon application talking to a database, extracting
the basic information via SQLTransformer and let it be displayed. So
far so good .. almost everything is fine, instead of one
thing. After
database communication creates the XML-file in (A) my XSLT
(B) should
transform it and give the output in a table .. But even after
successfully calling the correct template and print some nonsens for
debugging purposes I am still not able to address the sql createt
elements in the XML-file one level deeper ... :-/ u know what I
meen ? let me show you:
(A) generated XML File
--------------------------------
<speiseplan xmlns:xi="http://www.w3.org/2001/XInclude">
<tage nrofrows="5" name="tage"
xmlns:sql="http://apache.org/cocoon/
SQL/2.0" xmlns="http://apache.org/cocoon/SQL/2.0">
<tag>
<tag_id>1</tag_id>
<tag_name>Montag</tag_name>
</tag>
<tag>
<tag_id>2</tag_id>
<tag_name>Dienstag</tag_name>
</tag>
<tag>
<tag_id>3</tag_id>
<tag_name>Mittwoch</tag_name>
</tag>
<tag>
<tag_id>4</tag_id>
<tag_name>Donnerstag</tag_name>
</tag>
<tag>
<tag_id>5</tag_id>
<tag_name>Freitag</tag_name>
</tag>
</tage>
<content>
<rowset nrofrows="3"
xmlns:sql="http://apache.org/cocoon/SQL/2.0"
xmlns="http://apache.org/cocoon/SQL/2.0">
<row>
<essen_titel>Essen 1</essen_titel>
<essen_beschreibung>Senfeier
mit Backkartoffeln und
Schwarzwurzeln</essen_beschreibung>
<essen_preis>2.5</essen_preis>
</row>
<row>
<essen_titel>Essen 2</essen_titel>
<essen_beschreibung>Tomatensuppe, dazu Basilikum. Croutons und
Gewürze der Provence</essen_beschreibung>
<essen_preis>2.99</essen_preis>
</row>
<row>
<essen_titel>Bio-Essen</essen_titel>
<essen_beschreibung>Spaghetti
Bolognese mit frischem Parmesan</
essen_beschreibung>
<essen_preis>3.8</essen_preis>
</row>
</rowset>
</content>
</speiseplan>
(B) XSLT extract
----------------------
...
<xsl:template name="tag" match="sql:rowset">
<br/> <br/>
<p class="p">
<xsl:value-of select="$var"/>
</p>
<br/> <br/>
<table width="600" class="content_table" cellpadding="5"
cellspacing="0">
<tr>
<td class="content_table_top" width="20%">Titel</td>
<td class="content_table_top"
width="60%">Beschreibung</td>
<td class="content_table_top" width="20%">Preis in
EURO</td>
</tr>
<xsl:call-template name="essen"/>
</table>
</xsl:template>
<xsl:template name="essen" match="rowset/sql:row">
Here you have a mistake: rowset belongs to the sql namespace, so
use sql:rowset/sql:row. Always watch out for namespaces, they are
tricky. Once you are familiaar with it, you know where to look (for
example, sql:[EMAIL PROTECTED]'3']/sql:row would not work either, but
sql:[EMAIL PROTECTED]:rowset='3']/sql:row would)
<tr>
<td class="content_table_td" width="20%">b<xsl:value-of
select="sql:essen_titel"/></td>
<td class="content_table_td" width="60%">b<xsl:value-of
select="sql:essen_beschreibung"/></td>
<td class="content_table_td" width="20%">b<xsl:value-of
select="sql:essen_preis"/></td>
</tr>
</xsl:template>
...
(C) generated HTML extract
--------------------------------------
...
<table cellspacing="0" cellpadding="5" class="content_table"
width="600">
<tr>
<td width="20%" class="content_table_top">Titel</td><td width="60%"
class="content_table_top">Beschreibung</td><td width="20%"
class="content_table_top">Preis in EURO</td>
</tr>
<tr>
<td width="20%" class="content_table_td">b</td><td width="60%"
class="content_table_td">b</td><td width="20%"
class="content_table_td">b</td>
</tr>
</table>
Essen 1Senfeier mit Backkartoffeln und Schwarzwurzeln2.5Essen
2Tomatensuppe, dazu Basilikum. Croutons und Gewürze der
Provence2.99Bio-EssenSpaghetti Bolognese mit frischem Parmesan3.8
(D)
-----
Obvisously I want the Entries "Essen 1..." appear in the table and
not afterwards .. :-( and do undergo that mechanism as much as row-
elements appear, not only once as it is now .. (rember the rows of
"b" in (A))
Do you know an answer to that? currently it has driving me crazy for
5 hours ..
thanks and greetings
Andre
Regards Ard
--
Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel +31 (0)20 5224466
-------------------------------------------------------------
[EMAIL PROTECTED] / http://www.hippo.nl
--------------------------------------------------------------
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]