OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: purpose CDATA sections

[ Lists Home | Date Index | Thread Index ]
  • From: Eric Baatz - Sun Microsystems Labs BOS <ebaatz@barbaresco.East.Sun.COM>
  • To: Martin.Beet@ncl.ac.uk
  • Date: Fri, 15 Aug 1997 11:15:39 -0400 (EDT)

>  The only purpose of the CDATA section (CDSect) I can think of is for
>  showing code examples. Am I missing something?

By "code" do you mean XML markup?

Text other than XML markup can contain characters that might be mistaken
for XML and therefore should be escaped.  It may be more convenient
to stick the entire text into a CDATA rather than individually escaping
each character that an XML processor is sensitive to.  For example:

<EMAIL-HEADER>
<![CDATA[From: Martin Beet <Martin.Beet@ncl.ac.uk>]]>
</EMAIL-HEADER>


Similarly for more specialized text, such as the native commands of a
speech synthesizer (where I don't have any control over the syntax
accepted by the synthesizer):

<SYNTHCMDS ID="Croaker"><![CDATA[<voice=bullfrog><ribbit=1>]]></SYNTHCMDS>

The CDATA method may be easier to generate programatically and it may
be viewed as more readable than individually escaping characters.


Eric Baatz
Sun Microsystems Laboratories
2 Elizabeth Drive, MS UCHL03-207                 (508) 442-0257
Chelmsford, MA 01824                        fax: (508) 250-5067
USA                                    Internet: eric.baatz@east.sun.com


xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS