[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Transform XML into CDATA
is this you wanted to see ??
<IMAGE> <NAME>picture.jpg</NAME> <CAPTION> <![CDATA[Image info goes here<BR>Here is the comment<BR/> <a href="picture.jpg" target="_blank" /> <U>Open image in new window</U> ]]> </CAPTION> </IMAGE> because you have given the cdata-section-elements="CAPTION" all the text-only nodes under the caption node will be in the CDATA section.And so any other nodes are ever considered as CDATA, unless you actually make them CDATA (making them just any other text ) example: <xsl:text disable-output-escaping="yes"><![CDATA[<a href = "]]></xsl:text> Try this.,. <xsl:template match="record" mode = "image"> <xsl:element name="IMAGE"> <NAME> <xsl:value-of select="item[1]"/> </NAME> <CAPTION> <xsl:value-of select="item[2]"/> <xsl:if test="normalize-space(item[3])"> <xsl:text disable-output-escaping="yes"><![CDATA[<br/>]]></xsl:text> <xsl:value-of select="item[3]"/> </xsl:if> <xsl:text disable-output-escaping="yes"><![CDATA[<br/><a href = "]]></xsl:text> <xsl:value-of select = "item[1]"/> <xsl:text disable-output-escaping="yes"> <![CDATA[" target="_blank"/><U>Open image in new window</U>]]></xsl:text> </CAPTION> </xsl:element> </xsl:template> I have also changed the code a bit , where i thought could be changed. HTH Vasu From: Verakso <verakso@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Transform XML into CDATA Date: Tue, 14 Feb 2006 16:25:07 +0100 _________________________________________________________________ Be the first to hear what's new at MSN - sign up to our free newsletters! http://www.msn.co.uk/newsletters
|
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
|