> 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 to > 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 unicode > line separator (
). 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"> > > </fo:block> > > <fo:block> > > </xsl:text> > > </xsl:template> > Wrong way, disable-output-escaping implies serialization of a result tree > hence doesn't work otherwise, e.g. in mozilla, cocoon and fop. This facility > 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
