cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Alberto L." Gonçalves <rui-l-goncal...@ptinovacao.pt>
Subject Re: sql:block
Date Wed, 09 Jun 2004 13:22:56 GMT
On Wed, 2004-06-09 at 12:17, Patrick Schlaepfer wrote:
> After the SQLTransformer and Filter the xml files looks
> like: 
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>  - <page xmlns:sql="http://apache.org/cocoon/SQL/2.0">
>  <title>New Books List</title>
>  - <sql>
>  - <rowset xmlns="http://apache.org/cocoon/SQL/2.0">
>  - <block id="1">
>  - <row>
>  <id>460</id>
>  <hotelname>Adler</hotelname>
>  <adresse>Gerechtigkeitsgasse 7</adresse>
>  <plz>3011</plz>
>  <ort>Bern</ort>
>  <sterne>30</sterne>
>  <pic_l>2229</pic_l>
>  <doppel_min>0</doppel_min>
>  <einzel_min>0</einzel_min>
>  </row>
>  - <row>
>  <id>5949</id>
>  <hotelname>Alfa Bern</hotelname
> .... 
> 
> In the xslt there is:
> template match="/page"
> template match="title"
> template match="sql:rowset" 
> 
> and template match="sql:block[count(sql:row) > 0]" 
> 
> What exactly does the line above, and why it's not working,
> doesn't match the template... 

This:

match="sql:block[count(sql:row) > 0]

will match any element "block" that belongs to the 
namespace associated with prefix sql, if that block
has one or more child's called "row" belonging to the
same namespace.

In your stylesheet, to associate the prefix sql with
the correct namespace, do:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:sql="http://apache.org/cocoon/SQL/2.0"
                version="1.0">

Hope this helps.

Rui
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
-- 
Rui Alberto L. Gonçalves <rui-l-goncalves@ptinovacao.pt>
PT Inovação


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message