Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] CDATA sections

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: "New, Cecil (GE Trans)" <cecil.new AT ae.ge.com>
  • Cc: XOM-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] CDATA sections
  • Date: Tue, 04 Jan 2005 11:28:07 -0500

New, Cecil (GE Trans) wrote:

As long as there is no DTD, then a CDATA seems unecessary.

But if there is a DTD and it does not allow mixed content for <content>,
then a CDATA section would effectively sidestep validation issues...

Again, you are asking to do exactly what I maintain is a horrible idea. Content in CDATA is *not* markup , even if it looks like it is. Placing it in a CDATA section has not fixed your problem. There are two good solutions to the problem you encountered, neither of which requires hiding markup inside CDATA sections:

1. Change the DTD
2. Put the markup inside the relevant markup, even though the DTD says you can't. Validity is an option. It is not required.

Both of those solutions are more robust and maintainable than the very ugly hack of hiding unparsed markup in a CDATA section.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page