[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: cdata


diana castillo
also if your example is correct they have left off the trailing '>' on 
the cdata section.....

Joshua Allen wrote:

> Well, if they wanted you to be able to get at the text within the 
> CDATA node, they should have given you:
>
> <AccomodationName><![CDATA[HOTEL AC MALAGA PALACIO]]></AccomodationName>
>
> If they had, the text content of the node would be:
>
> “HOTEL AC MALAGA PALACIO”
>
> Instead, the double-escaped it so that the CDATA tag is part of the text:
>
> “<![CDATA[HOTEL AC MALAGA PALACIO]]>”
>
> Since you are getting an opaque text node which just happens to 
> contain some CDATA syntax, you will need to re-parse the text node if 
> you want to extract the text from within the CDATA brackets. To do 
> this, you would need to extract the string, then pass it back through 
> another XML parser instance which is capable of handling fragments. 
> You could also theoretically just extract the inner part using string 
> manipulation routines or RegExp.
>
> ------------------------------------------------------------------------
>
> *From:* Diana Castillo [mailto:diana@hotelkey.com]
> *Sent:* Wednesday, June 09, 2004 10:00 AM
> *To:* xml-dev@lists.xml.org
> *Subject:* [xml-dev] cdata
>
> anyone know why my parser is not reading just the internal part of 
> this tag?
> Is the cdata in the correct format?
> <AccommodationName>&lt;![CDATA[HOTEL AC MALAGA
> PALACIO]]&gt;</AccommodationName>
>
> (I cannot change how the xml comes to me, they send it to me like that)
>
> Diana Castillo
> Global Reservas, S.L.
> C/Granvia 22 dcdo 4-dcha
> 28013 Madrid-Spain
> Tel : 00-34-913604039
> Fax : 00-34-915228673
> email: diana@hotelkey.com <mailto:diana@hotelkey.com>
> Web : http://www.hotelkey.com
> http://www.destinia.com
>
>------------------------------------------------------------------------
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://www.oasis-open.org/mlmanage/index.php>
>

begin:vcard
fn:Rick  Marshall
n:Marshall;Rick 
email;internet:rjm@zenucom.com
tel;cell:+61 411 287 530
x-mozilla-html:TRUE
version:2.1
end:vcard


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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