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


Help: OASIS Mailing Lists Help | MarkMail Help



   CDATA Section Support (was RE: SAX2 RFD: LexicalHandler draft v.1.1)

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: "'XML Developers' List'" <xml-dev@ic.ac.uk>
  • Date: Wed, 24 Mar 1999 14:37:06 -0500 (EST)

Ronald Bourret writes:

 > The obvious place where preservation of CDATA is important, then,
 > is when I'm co-authoring a document with a friend who uses a
 > DOM-based editor while I prefer a text editor.  If every time my
 > friend edits the document all the CDATA sections get wiped out,
 > neither our friendship nor our co-authorship are going to last very
 > long.

Yes, but there would be easier ways to handle this.  Let's say, for
example, that you consistently use the following in your text editor:

  <s>This is literal XML markup used as an example</s>

Now, if CDATA boundaries were discarded, when your friend loaded this
into her DOM-based editor and then saved it again, you would see
something like the following:

  &#60;s&#62;This is literal XML markup used as an example.&#60;/s&#62;

If this kind of thing does matter (as it probably would to you),
perhaps your friend could configure her editor to select certain
element types that would always have their content CDATA escaped on
export (nearly every document type has only one or two candidates,
such as HTML <pre>).

Even if your friend's editor didn't support that, nearly anyone on
this list could hack together a Perl or Java program in about 15
minutes that you allow you to do something like

  xml-cdata-escape mydoc.xml example > mydoc2.xml

Voila, your CDATA is back!  Of course, there are a few situations
where people use CDATA less predictably, but I hardly believe that the
requirement would survive a real cost-benefit analysis if the DOM WG
had made one.

All the best,


David Megginson                 david@megginson.com

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto: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