You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Charles Griswold <cg...@logixpartners.com> on 2005/04/03 19:32:34 UTC

XSLT and FO Formatting question

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.
I thought I could replace these sysbols with <fo:block font-weight = 
"bold"> and </fo:block> .
I don't seem to be able to do a replacement where the FO tags are 
produced correctly. 
If I substiture the &lt; , &quote; and &gt; symbols for the tag symbols 
I can process the text but the symbols are not resolved in the output. 
If I use the < > character the xslt processor complains.

So am I thinking of this the right way?
Can someone offer a working example for something like this?

Thanks in advance
Charles Griswold

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


Re: XSLT and FO Formatting question

Posted by "J.Pietschmann" <j3...@yahoo.de>.
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.
> I thought I could replace these sysbols with <fo:block font-weight = 
> "bold"> and </fo:block> .
> I don't seem to be able to do a replacement where the FO tags are 
> produced correctly. If I substiture the &lt; , &quote; and &gt; symbols 
> for the tag symbols I can process the text but the symbols are not 
> resolved in the output. If I use the < > character the xslt processor 
> complains.
> 
> So am I thinking of this the right way?

I don't think so. XSLT can't produce tags, it will produce
nodes only. Replacing text with other text using XSLT wont
insert new XML elements the result, even if the replaced text
resembles XML tags.

You'll have to do stream editing, for example as provided by sed
or perl, for this kind of text substitution, before the input is
fed to an XML parser.

J.Pietschmann


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


RE: XSLT and FO Formatting question

Posted by Victor Mote <vi...@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.
> I thought I could replace these sysbols with <fo:block 
> font-weight = "bold"> and </fo:block> .
> I don't seem to be able to do a replacement where the FO tags 
> are produced correctly. 
> If I substiture the &lt; , &quote; and &gt; symbols for the 
> tag symbols I can process the text but the symbols are not 
> resolved in the output. 
> If I use the < > character the xslt processor complains.
> 
> 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.

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

Victor Mote


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