[racket] cdata section is not normalized by read-xml

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Wed Nov 10 00:06:54 EST 2010

It is documented that way:

http://docs.racket-lang.org/xml/index.html#(def._((lib._xml/main..rkt)._cdata))

I'm not sure why it was originally written that way.

Jay

On Tue, Nov 9, 2010 at 9:53 PM, YC <yinso.chen at gmail.com> wrote:
> Hi all -
> read-xml apparently does not normalize/strip the <![CDATA[ ... ]]> wrapper
> when creating the cdata struct.  Is there a reason why they are not
> stripped?
>
> #lang scheme
> (require xml)
> (define xml "<test><![CDATA[this is cdata]]></test>")
> (define xexpr (xml->xexpr (document-element (read-xml (open-input-string
> xml)))))
> (cdata-string (last xexpr))
> ;; => "<![CDATA[this is cdata]]>"
> ;; better as => "this is cdata"
>
> Thanks,
> yc
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93


Posted on the users mailing list.