Re: Re: How to create CDATA tags with XML_Serializer
| From: | Justin Patrin | Date: | Wed, 12 Jan 2005 21:58:35 +0000 |
| Subject: | Re: Re: How to create CDATA tags with XML_Serializer | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16903@lists.php.net to get a copy of this message | ||
On Wed, 12 Jan 2005 20:48:58 +0100, Torsten Roehr <roehr@zilleon.com> wrote:
> Hi Stephan,
>
> "Stephan Schmidt" <schst@php.net> wrote in message
> news:20050112191810.88310.qmail@pb1.pair.com...
> > Hi,
> >
> > Torsten Roehr schrieb:
> > > Hi,
> > >
> > > what is the best way to create CDATA when serializing an array into XML
> with
> > > XML_Serializer? If it's done manually by using a string like
> > > <![CDATA[test]]> the < and > are converted to their respective html
> special
> > > chars. How can this be avoided? Applying html_entity_decode() as the
> encode
> > > function doesn't help as htmlspecialchars() seems to be applied
> afterwards.
> >
> > Why do you need to create CData sections?
>
> To include any kind of characters that should not be parsed as XML.
htmlentities is already run on the data in a tag (AFAIK) and this
fixes this problem. The XML parser is supposed to convert them back.
>
> > This currently is not
> > possible, you can add it as a feature request (in the bug tracker) and
> > I'll implement this as soon as I have some time.
>
> I'll do this. By the way, your package is excellent. Takes some time to find
> the right options but then it works like a charm!
>
> Thanks, Torsten
--
Justin Patrin