XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Sushant PrabhuSubject: cannot apply cdata-section-elements to xsl:copy-of select
Author: Sushant Prabhu
Date: 30 Jan 2007 10:57 PM
Hi All,

Currently I have a scenario where in I m using
-----------------------
<xsl:output method="xml" cdata-section-elements="mycountry myartist" indent="yes" />
-----------------------

I have the following code in my xsl
--------------------------
<mycountry> <xsl:copy-of select="country/node()"/> </mycountry>
<myartist> <xsl:value-of select="artist"/> </myartist>
--------------------------
The reason I am using <xsl:copy-of select> is because the data in the country tag has html elements & I need to retain the same. This was not happening with <xsl:value-of select> tags.

But I also have to wrap that piece of data into CDATA tags because that is what the external application to whom we send the data demands.

So the cdata wraps the data correctly with <xsl:value-of> but fails to do the same for <xsl:copy-of>
I need to know how can i workaround the same.

Please do post your comments


Regards


Posttop
Tony LavinioSubject: cannot apply cdata-section-elements to xsl:copy-of select
Author: Tony Lavinio
Date: 01 Feb 2007 08:57 AM
value-of converts the selection to a string. So you'll lose any
markup when using it.

copy-of retains the structure.

But what you appear to want is for the source to be serialized and
then wrapped in CDATA.

How is this related to Stylus Studio? This appears to be a general
XSLT-related question, which is better handled on the xsl-list mailing
list.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.