J.Pietschmann wrote:
Abel Braaksma wrote:
In the case you are using XSLT 2 (and in the event you haven't
applied a filter yet), here is an easy solution you can use for all
your templates:
<xsl:output use-character-maps="remove-SHY" />
I was under the impression that output maps are only applied if
the transformation result is serialized, which is not the case
if the FO process is chained to the transformation using SAX
events.
Can anybody confirm that output maps work even in the latter case?
I never thought of that, but you are right, of course. Though I am not
certain how processors actually deal with this when you do an in-memory
transformation, processors are allowed to ignore xsl:output and
xsl:character-map. Here's the quote from the XSLT 2 REC that says so:
"When serialization is not being performed, either because the
implementation does not support the serialization option, or because the
user is executing the transformation in a way that does not invoke
serialization, then the content of the xsl:output and xsl:character-map
declarations has no effect. Under these circumstances the processor may
report any errors in an xsl:output or xsl:character-map declaration, or
in the serialization attributes of xsl:result-document, but is not
required to do so."
However, the workaround is simple (but a bit more time-consuming for the
processor to perform, and perhaps to implement):
<xsl:value-of select="replace( $your-shy-value, '­', '' )" />
You'll have to do this for every text node containing a SHY. If you find
that too cumbersome (I would), another resolution is be to wrap your
result in a temporary result tree, and apply an identity template to it:
<xsl:template match="/" >
<xsl:variable name="temp-result">
<!-- apply your normal templates as they are now -->
<xsl:apply-templates />
</xsl:variable>
<xsl:apply-template select="$temp-result/*" mode="remove-SHY" />
</xsl:template>
<xsl:template match="text()" mode="remove-SHY">
<xsl:copy-of select="replace( . , '­', '' )" />
</xsl:template>
<!-- copy template -->
<xsl:template match="node() | @*" mode="remove-SHY">
<xsl:copy>
<xsl:apply-templates select="node() | @*" mode="#current" />
</xsl:copy>
</xsl:template>
that way you only have to change your existing code at one spot (but
note that the serialization option is less processor-intensive, so if
you do some serialization before applying FOP, go for that option).
Cheers,
-- Abel Braaksma
http://www.nuntia.nl
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]