|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Attributes and entity references
> How can I generate an entity reference as value of
> an output attribute?
You can't, in general, basically because entity references don't exist
in the xpath tree model of an XML document.
1.)
XSLT: <elt attr="&MR;"/>
the output is <elt attr="&MR;" />
as you'd expect.
2.) XSLT:
<elt>
<xsl:attribute name="attr">
<xsl:text disable-output-escaping="yes">&MR;</xsl:text>
</xsl:attribute>
</elt>
the output is <elt attr="&MR;" />
disable-output encoding is
a) evil and
b) only a hint that the processor is explictly allowed to ignore.
The first question is why do you need to the entity reference in the
output (as opposed to just putting the value of the MR entity there).
If you do need to do that, then if disable-output-escaping doesn't work
for you then there is always the option of outputting [entity-ref]MR;
and then applying
sed -e "s/[entity-ref]/&/g"
to your output.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








