[martin@loewis.home.cs.tu-berlin.de: Re: [XML-SIG] Thought it was a bug, maybe XML is weirder than I thought]

Clarence Gardner clarence@netlojix.com
Sun, 1 Oct 2000 15:33:03 -0700


From: "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>I can't see a problem here. AFAIK, <![CDATA[<markup test>]]> is really
>equivalent to &lt;markup test&gt; from an XML point of view.

Sure.  I did that test to make sure it didn't change it to a text
node containing the literal "<markup test>".  But what really got me
was that <element username>[text] got changed to
<element username>[<text><text><text>].  On further reflection, I can
see that my previous concern about two original TEXT children of <username>
was nonsensical (if they were really distinct, they should be elements),
but nonetheless, the lesson about having to concatenate all TEXT children
to get the original text value seems to be true.

>
>You did not say exactly how this reading or writing was achieved (SAX,
>DOM, something else). Whatever procedure was used to write this, I
>guess it should be possible to change it so that Text nodes (in the
>DOM sense) come out as CDATA sections - if that is really a
>requirement.

It's not that I have a love affair with CDATA, I just wanted to be sure
that arbitrary text wouldn't cause a problem.
I'm doing what is presumably the vanilla use of the package:
    p = saxexts.make_parser()
	dh = SaxBuilder()
	p.setDocumentHandler(dh)
	p.parseFile(f)
	...
	dh.doctoxml()

-- 
Clarence Gardner
Software Engineer
NetLojix Communications
clarence@netlojix.com