Re: [xsl] CDATA Handling

Subject: Re: [xsl] CDATA Handling
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 06 Jan 2009 11:36:48 -0500
At 06:52 AM 1/6/2009, David wrote:
> May be it is easier to pick the inside text of CDATA.

If you are using XML input, it's best to process it with XML tools, in
which case processing two identical inputs should have the same
difficulty. Admittedly if you are not really using XML, and just grabing
bits of text using string handling then specifying all sorts of non XML
constraints, such as use of CDATA or use of particular attribute quoting
style, and particular character encoding, may, possibly make sense,

But of course this wouldn't be a conforming XML application; it would just pretend to be "XML".

The bottom line is that CDATA marked sections look like markup, but they're not. They are lexical cruft, having nothing to do with information as modeled in an XML system. They express nothing in XML that couldn't be expressed otherwise. They could have been left out of XML altogether and the semantics of XML as an information modeling and processing technology would be the same.

But because they're there, and because they look like markup, and because they do mean something to a parser, they offer potentials for headaches. When used properly, as a merely syntactic alternative to escaping markup characters, they're a harmless convenience. When they invade processing semantics, they're an accident waiting to happen.


Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
  Mulberry Technologies: A Consultancy Specializing in SGML and XML

Current Thread