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 February 23rd, 2007, 02:21 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to read cdata in xsl

i want to get cdata section under a perticular tag...
is there any way to read cdata section of xml in my xsl??
how can i get the cdata section contain...
 
Old February 23rd, 2007, 05:02 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

CDATA section boundaries are not accessible in the XSLT/XPath data model. CDATA boundaries should never be used to convey significant information - that's what elements are for. CDATA is simply an input convenience to save you from escaping special characters - like the SHIFT LOCK key on your keyboard (you can't detect that either....)

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 23rd, 2007, 05:48 AM
Authorized User
 
Join Date: Feb 2007
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i just need the contain under the cdata...so there is no way to get this contain in xsl??
 
Old February 23rd, 2007, 06:30 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Do I have to tell you the answer twice for you to believe me?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 26th, 2007, 04:34 AM
Registered User
 
Join Date: Jan 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Gantait,

Can you supply an example of the xml and the result you require?
It is unclear if you simply need to retrieve the complete contents of the "cdata section" or a portion of it?

For example, given the following xml:

<foo>
   <bar><![CDATA[<b>this</b> is my cdata]]></bar>
</foo>

Do you need to retrieve: "<b>this</b> is my cdata"
Or perhaps: "<b>this</b>" ?

Bryan
http://www.3chillies.co.uk











Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read Array using XSL chaitanya_619 XSLT 7 May 28th, 2008 12:29 PM
How to read XSL from jar present in applications l Archana144 Spring 1 March 21st, 2008 06:49 AM
Render HTML inside CDATA with XSL c2c XSLT 0 September 10th, 2006 11:10 AM
Read XSL File Neal Excel VBA 1 April 7th, 2006 06:47 AM
cdata-section-elements in xsl:output ROCXY XSLT 1 March 2nd, 2006 11:44 AM





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