Subject: Re: [xsl] CDATA question From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 14 Apr 2004 22:57:52 +0100 |
<xsl:template match="emphasis"> <b><xsl:apply-templates/></b> </xsl:template> That would generate a b element in the output, but you don't want a b element you want <xsl:template match="emphasis"> <b><xsl:apply-templates/></b> </xsl:template> as what you want is <mattext texttype="text/html"><![CDATA[Select the <b>GPO Part Additional Info</b> link in the <b>Navigation</b>screen.]]></mattext> which is the same thing as <mattext texttype="text/html">Select the <b>GPO Part Additional Info</b> link in the <b>Navigation</b>screen.</mattext> The difference between using CDATA and using < should be seen as a purely syntactic artifact with no difference in meaning just as using " or ' around attribute values has no effect on the meaning. So you use the same xslt templates in either case, and just request the CDATA style of linearisation. Since you have used cdata-section-elements="mattext feedback"> The text node will be output in CDATA style (even if entered using <) but you have to create a single text node, not a a tree of elements and attributes. Of course better, if you have any control over the output format, is not to use a CDATA section and to have elements in there. Since that <b> is presumably intended to be markup, it's slightly peverse (although depressingly common) to declare that it is _not_ markup but C(haracter )Data. David -- http://www.dcarlisle.demon.co.uk/matthew ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] CDATA question, G. Ken Holman | Thread | RE: [xsl] CDATA question, Uslu, Cihan Y (MED) |
Re: [xsl] CDATA question, G. Ken Holman | Date | RE: [xsl] CDATA question, Michael Kay |
Month |