xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas L. Delmelle" <a_l.delme...@pandora.be>
Subject RE: XSLT and FO Formatting question
Date Mon, 04 Apr 2005 16:36:24 GMT
> -----Original Message-----
> From: Victor Mote [mailto:vic@outfitr.com]
> Charles Griswold wrote:
> > I have and xml input stream that has text embeded with
> > symbols that I'd like to translate into FO command For
> > Instance, the text has '##b' and '##/b' to indicate the
> > beginning and end of bold text in the output.
<snip />
> > So am I thinking of this the right way?
> > Can someone offer a working example for something like this?
> I don't have a working example, but the basic building blocks
> would seem to be the substring-before() and substring-after()
> functions to parse the content, then xsl:element to create
> the desired element.

That's indeed the way to go with XSLT 1.0.
XSLT 2.0 seems better equipped to handle this sort of thing (i.e.
xsl:analyze-string... You can do all kinds of beautiful things with regexp
Downsides are that :
1) you will *have* to use another XSLT processor than Xalan (most likely
Saxon, not sure which other processes already implement parts of the XSLT
2.0 WD)
2) the built-in Schema support in XSLT 2.0 can turn out to be a real pain
(if you're used to writing templates for 1.0 and don't really need the
rigorous type-checking offered by Schema).

> Of course, better yet, if possible, is to replace the formatting semantics
> from the input xml document with elements.

Always the preferrable option, especially when working with XSLT 1.0, as the
eventual solution leans much more towards the 'standard' XSLT
processing-model (as in: applying templates to XML nodes).



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

View raw message