RE: [Announce] Escaping double quotation marks in XSL
"Timothy Jones" <[email protected]> Wed, 24 Oct 2007 12:14:28 -0400
| Newsgroups | gmane.text.xml.general |
|---|---|
| Message-ID | <044F2EDDF4FCA24A965ECAA66CB9345C01427469__6397.15022775835$1193267178$gmane$org@vdsexc02> |
Maybe you should explore something like this:
<xsl:element name='image'>
<xsl:for-each select='@*'>
<xsl:attribute name='qname(.)'><xsl:value-of select='.'
/></xsl:attribute>
</xsl:for-each>
</xsl:element>
This way, the transformer is at least aware of the tag you are trying to
insert into the output.
tlj
________________________________
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, October 24, 2007 11:58 AM
To: Brian Minchau
Cc: [email protected]; [email protected];
[email protected]
Subject: Re: [Announce] Escaping double quotation marks in XSL
> Assuming that you are only interested in stream serialization, have
you
> thought of doing the serialization yourself for particular elements?
For
> example, something like this:
>
> <!-- self serialization of image elements with tag for image done in
> CDATA,
but delegate attributes serialization -->
> <xsl:template match="image">
> <![CDATA[ <image]>><xsl:apply-templates select="@*"/> <![CDATA[ >]>>
> </xsl:template>
I *REALLY* detest that idiom. I've seen many people hurt themselves by
trying to hand-generate XML; I consider it a very bad practice. Unless
you're forced to do it in order to work with a downstream tool which has
not been implemented correctly, I would recommend finding another
solution. Any other solution.