Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2010, 04:52 PM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default cdata section elements and version in xsl:output

Hi,

I am generating an rss feed. The elements (title and description) in the feed needs to be wrapped with CDATA. In my xsl:output I am passing the title and description to the attribute cdata-section-elements.

<xsl:output name="feed" method="xml" cdata-section-elements="title description" indent="yes"/>

This works fine. But I don't get an xml version information in the generated file as I am not including the attribute omit-xml-declaration="yes" in xsl:output
<?xml version="1.0" encoding="utf-8" ?>

If I pass the attribute I don't see the cdata wrapped to the elements
<xsl:output name="feed" method="xml" omit-xml-declaration="yes" cdata-section-elements="title description" indent="yes"/>

I didnot understand the relation between these two attributes. Is it mandatory that a generated xml file should have the version, if I tried to skip the omit-xml-declaration attribute to get cdata wrapped to the elements?

Any information will be of great help.

Thanks,
irs
 
Old July 7th, 2010, 05:39 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I can't see any reason why these two attribute should interact.

I suggest you provide a sample stylesheet, show the output you are getting on your processor (and tell us which this is), and let us try it on some different processors.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a CDATA section; add nodeset to CDATA section kssudhish XSLT 3 January 3rd, 2008 07:13 AM
CDATA Section using XSLT misanaka XSLT 2 March 29th, 2007 06:53 PM
XSD CDATA Section chrisjonmcdonald XML 4 July 12th, 2006 08:15 AM
cdata-section-elements in xsl:output ROCXY XSLT 1 March 2nd, 2006 11:44 AM
CDATA section kai77 Beginning VB 6 0 October 31st, 2004 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.