Re: [Announce] Escaping double quotation marks in XSL

Brian Minchau <[email protected]> Wed, 24 Oct 2007 12:27:30 -0400
Newsgroups gmane.text.xml.general,gmane.text.xml.xalan.java.user
Message-ID <OFBF552AC7.266F46BC-ON8525737E.005A2744-8525737E.005A68A7@ca.ibm.com>
I don't like the idiom either. I agree that any other solution would be
better.  It made my stomach turn to suggest it.

Other suggestions for a solution?


- Brian



                                                                           
             [email protected]                                             
             m                                                             
                                                                        To 
             10/24/2007 11:58          Brian Minchau/Toronto/IBM@IBMCA     
             AM                                                         cc 
                                       [email protected],             
                                       [email protected],             
             Please respond to         [email protected]        
             [email protected]                                     Subject 
                   e.org               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.