Fwd: [XML-SIG] xmlpickle.py ?!

tpassin@home.com tpassin@home.com
Wed, 9 Aug 2000 08:06:39 -0400


Fredrik Lundh wrote this amazing hack -

tom passin wrote:
> > ...
> > How robust is this CDATA wrapping ? What if the data itself
> > is XML and contains a CDATA section ?
> >  ...
> 
> You can't nest CDATA sections - see sec. 2.7 of the XML Recommendation.
> CDATA can't contain the ']]>' sequence - it always denotes the end of the
> CDATA section, hence no nesting.

> CDATA sections cannot nest, but that doesn't mean that you
> cannot store ]]> as CDATA:

>    output = string.replace(data, "]]>", "]]]><![CDATA[]>")

Holy cow, /F!  But did you really mean

output = string.replace(data, "]]>", "]]]><![CDATA[]]]>")

<sigh>I could never write those really tricky batch files, either.</sigh>

Astoundedly-yours-for-sure,

Tom Passin