473,472 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Special characters within CDATA

Hi

Could you please let me know

When i specify an attribute of an XML Tag as CDATA in DTD , can i use
& straight away within the value of that attribute (instead of using
& AMP ;) . If we cant use what is the purpose of specifying an
attribute as CDATA in DTD?

any help is appreciated
Thanks

Jul 31 '07 #1
3 4328
* raga wrote in comp.text.xml:
When i specify an attribute of an XML Tag as CDATA in DTD , can i use
& straight away within the value of that attribute (instead of using
& AMP ;) . If we cant use what is the purpose of specifying an
attribute as CDATA in DTD?
You have to escape them regardless. Its primary use is to specify a type
when none of the other types suits your needs (which is often the case.)
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jul 31 '07 #2
There are two different things called CDATA in XML, with different
behavior: the CDATA datatype (character data, used for otherwise-untyped
attribute values) and the CDATA Section (using <[CDATA[]]as an
alternative to escaping individual characters).
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Jul 31 '07 #3
raga wrote:
Hi

Could you please let me know

When i specify an attribute of an XML Tag as CDATA in DTD , can i use
& straight away within the value of that attribute (instead of using
& AMP ;)
No.
If we cant use what is the purpose of specifying an
attribute as CDATA in DTD?
It's a historical relic: SGML had many other datatypes, but only some
were retained in XML. In any case, as Joe has explained, CDATA in an
attribute declaration is handled differently from CDATA in a marked
section, for unrelated and irrelevant historical reasons ;-)

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Jul 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John van Terheijden | last post by:
Hi. I'm trying to develop a program that uses XML files store data. I'm using Windows XP, Apache 1.3.29 and PHP 4.3.4. Right now the XML file is read using the xml_parser_create(),...
2
by: nowhere | last post by:
Hi, I need to preserve some ASCII control characters (CR and LF) within an XML file so I have included the data in a CDATA section. However, when parsing it using expat, I lose the CR...
6
by: Dario Di Bella | last post by:
Hi all, I hope someone can help me on this. I need to parse the following XML: .... <area name="promotore"> <item id="004" code="003" description="attivita promotore"> <!]> </item> </area>...
3
by: Tjerk Wolterink | last post by:
Helo i'v an xml file like this: <bestand> <id>8</id> <beschrijving type="string"><!]></beschrijving> <file type="file" mime-type-image="/xcm/mime_types/movie.gif"><!]></file> </bestand>
2
by: Thierry Lam | last post by:
Let's say I have the following xml tag: <para role="source">a & b</para> Currently, an xml parser will treat & as a special character. Does anyone know the special characters to use around...
6
by: Cade Perkins | last post by:
How can the CDATA ending delimiter "]]>" be represented within a CDATA section itself? Consider an XML document that is intended to contain an embedded, uninterpreted XML example. Generally,...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
2
by: Diilb | last post by:
I am using DOM to create an rss feed. The problem I am running into is "special characters" such as é è ç. If I try adding them to the XML as character data (CData), DOM chokes and throws out...
0
by: Sebarry | last post by:
Hi, I have the following XML file which looks fine rendered in a browser but when its read by a SWF as a news ticker I get all these weird squares appearing. Any ideas? <?xml version="1.0"?>...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.