Someone else suggested caution due to the restriction of not being able to
nest CDATA. I could see how this could require someone to be careful if
they use CDATA to represent code (e.g., a SQL statement) that was created
with content that was also CDATA section wrapped (not a big problem - just
have to be careful to wrap and unwrap at the right times).
Anyways, I really do appreciate the discussion.
From: John E. Simpson [mailto:[log in to unmask]]
Sent: Wednesday, February 07, 2001 1:50 PM
To: [log in to unmask]
Subject: Re: Using CDATA blocks in elements?
At 01:31 PM 02/07/2001 -0800, Jerry Murray wrote:
>I am doing exactly that - persisting as XML (all the processing is within
>the data writer/reader and the parser sees only well formed fragments. But
>using the other appraoch, are there problems with persisting CDATA wrapped
> <data_entered><![CDATA[A < B && B <= C]]></data_entered>
Ah, I see what you're getting at now. No, there's no real problem except
for the extra overhead required to store the CDATA wrapper. Whether this is
a lot of overhead or only a little depends on the data. Of course if the
special characters show up only rarely, wrapping *all* element content in
CDATA sections may not make much sense at all, since the overhead will be
almost always unnecessary.
Sorry for not "getting" the question in the first place. :)
John E. Simpson | "Is it weird in here, or is it just
http://www.flixml.org | me?" -- Steven Wright
XML Q&A: www.xml.com |