On 17.03.2008 16:49:21 Fournier,Danny [NCR] wrote:
> I may be on to something...
> 
> In my XSLT, I have a few lines like these:
> 
> <xsl:text disable-output-escaping="yes">&lt;fo:page-sequence
> master-reference="myPages"&gt;</xsl:text>
> <xsl:text disable-output-escaping="yes">&lt;fo:flow
> flow-name="xsl-region-body"&gt;</xsl:text> 
> 
> Then later
> 
> <xsl:text disable-output-escaping="yes">&lt;/fo:flow&gt;</xsl:text> 
> <xsl:text
> disable-output-escaping="yes">&lt;/fo:page-sequence&gt;</xsl:text>

This is a hack and you should never do that! It leads to trouble because...
(see below)

> If I transform the XML and XSLT using Coldfusion, I get a valid FO
> document that can be converted into PDF using FOP and the command line.
> 
> I suspect that the processing of the XML/XSLT by FOP is different? Since
> I'm outputting these tags using xsl:text rather than having the tags
> present in the XSLT file, that's probably why it's not finding it and
> I'm getting an error?

Exactly. In the first case you serialize the XML to a file. It is later
reparsed and everything looks good. But if you do the XSLT step together
with FOP, the XML is not serialized. Instead what you're generating is
just text instead of internal startElement()/endElement() method calls
which FOP needs to work properly. The XSLT process and FOP are coupled
through a SAX stream, not a text stream.

> Dan
> 
> PS: since I'm opening and closing these tags in different templates, I
> had no choice to use xsl:text. I may have to review my XSLT in order to
> have these tags present rather than having to output them using
> xsl:text.

Yes, you'll have to rewrite that part of your XSLT. I know it's
sometimes a bit difficult to rid yourself of the sequential way of
programming of most programming languages. XSLT is different, strictly
hierarchical, declarative. Good luck!

<snip/>



Jeremias Maerki


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

Reply via email to