xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Haberman" <steph...@chase3000.com>
Subject RE: breaking paragraphs and lines
Date Wed, 06 Nov 2002 02:29:57 GMT
> Processing xml as text is kinda dangerous, especially when you are
trying to
> fiddle with tags, I believe a better and more safe way is to handle
\n\n stuff
> one stage earlier - during fo generation, that's pretty simple in xslt
> tokenize string into blocks by any delimiter, trivial recursive
template can
> do that.

Very cool. I'm really surprised to see how powerful, though arcane, XSLT
is. I naively thought that since I can't write imperatively, it's not a
programming language, and if something isn't in the XSL spec, it's
hard/impossible to do.

But with the hint of the tokenizing stuff be trivial, I took the
initiative I should have had before and found some 3rd
libraries/algorithms to do the \n\n -> <fo:block/> conversion. Nice.

> > <content>
> >    This is a long line that I want broken<br/>here.
> > </content>
> Search in the archive - that's faq, you can use either <block/> or
> line separator (&#x2028;).

Egads. Sorry for not following the best practice of searching the
archives. This little topic of breaking is mentioned all over the place.

> > <xsl:template match="br">
> >   <xsl:text disable-output-escaping="yes">
> >     &lt;/fo:block&gt;
> >     &lt;fo:block&gt;
> >   </xsl:text>
> > </xsl:template>
> Wrong way, disable-output-escaping implies serialization of a result
> hence doesn't work otherwise, e.g. in mozilla, cocoon and fop. This
> is for generating text (e.g. SQL), but not markup.

Huh. Interesting.

Thanks for all the great information, things are going much smoother
now. And sorry for not doing my homework first; I really should have
known better.

- Stephen

View raw message