cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <>
Subject Re: Cocoon PDF creation problems
Date Mon, 20 May 2002 16:55:42 GMT
Spectron International, Inc. wrote:
> And yes I'm using disable-output-escaping somewhere. Don't tell me I cant?

Exactly. This is a VFAQ and standard l0ser trap.
XSLT works on a node tree, not on XML strings.  You try to
generate tags by using d-o-e. This works if the tree is
serialized to a string and reparsed. In Cocoon (and other
applications), the constructed result tree is passed to
the next pipeline stage without being serialized.
What you think of "tags" is still text.

> I
> need it because I have the following xml :
> <data>
>   <number>1</number>
>   <number>1</number>
>   <number>1</number>
>   <number>1</number>
>   <number>1</number>
>   <number>1</number>
> </data>
> and I want a table with 3 numbers in each row, there can be from 1 to 300
> numbers.

This problem occurs very often and is known as "grouping by position".
Look into the XSL FAQ:

The standard solution is
       <xsl:for-each select="number[position() mod 12=1]">
         <xsl:for-each select=".|following-sibling::number[position() &lt; 12]">
           <fo:block font-size="12pt" text-align="end"
              padding-bottom="10pt"><xsl:value-of select="."/></fo:block>

Repeat: XSLT operates on nodes, not on strings with tags.
You can't create half a node. You have to understand this
in order to use XSLT efficiently, especially in the Cocoon


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message