At 2004-10-22 09:28 +0130, Stefan Borchert wrote:
I've got the following source:
<xsl:element name="span">
<xsl:attribute name="title">
<xsl:text disable-output-escaping="yes">Gäste</xsl:text>
</xsl:attribute>
<xsl:text disable-output-escaping="yes">Gäste</xsl:text>
</xsl:element>
Then I process it via PHP (and Sablotron 1.0) and it produces:
'<span title="G&auml;ste">Gäste</span>' instead of the expected
'<span title="Gäste">Gäste</span>'.
I would not expect what you say you are expecting.
Instead of getting any result, you should be getting an error because XSLT
1.0 Section 16.4 states "It is an error for output escaping to be disabled
for a text node that is used for something other than a text node in the
result tree."
You are not disabling output escaping for a text node.
Furthermore, you could more easily say:
<span title="Gäste">Gäste</span>
and get the equivalent emitted to your result. XSLT 1.0 does not give you
control over the choice of output serialization syntax for entity references.
If you wanted your stylesheet to be more legible, you could have:
<!DOCTYPE xsl:stylesheet
[
<!ENTITY auml "ä">
]>
<xsl:stylesheet ....
<span title="Gäste">Gäste</span>
.... but still this gives no indication to the output syntax for the entity
reference.
Are you trying to make your stylesheet easier to read, or are you trying to
control the output syntax? If the latter, why are you trying to do so when
the choice of syntax does not matter to a browser, as long as the processor
has made an appropriate choice of syntax?
I hope this helps.
....................... Ken
--
World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal