Re: Problems with Config - which leads to problems with XML_Parse
| From: | Bertrand Mansion | Date: | Tue, 19 Aug 2003 14:02:34 +0000 |
| Subject: | Re: Problems with Config - which leads to problems with XML_Parse | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20053@lists.php.net to get a copy of this message | ||
<stefan@neufeind.net> wrote :
> On 19 Aug 2003 at 15:35, Bertrand Mansion wrote:
>
>> <wentz@gmx.de> wrote :
>>
>>> Lukas Smith wrote:
>>>
>>>> I think the problem is in the Config container.
>>>> When you are reading in chunks you need to append the cdata to the
>>>> value you are storing. When a cdata is split up into two chunks the
>>>> cdata handler is called twice.
>>>
>>> Yes, thats it...
>>> should've looked into the code that the php-example produced:
>>> <item>inc_functions.php</item>
>>> was printed to
>>> inc_functions.php
>>> but in the source you'll see:
>>> <b>inc_fu</b><b>nctions.php</b>
>>>
>>> the character-handler ist called 2 times...
>>
>> Can you modify Config_Container_XML::cdataHandler like this and tell
>> me if it works any better :
>>
>> function cdataHandler($xp, $cdata)
>> {
>> $cdata = trim($cdata);
>> if ($cdata != '') {
>> $container =&
>> $this->containers[count($this->containers)-1];
>> $container->setType('directive');
>> $container->setContent($container->getContent().$cdata);
>> }
>> } // end func cdataHandler
>
> Wow Bertrand, really admiring :-) Didn't have time to look and the
> code yet and you already solved it ... that's cool, folks :-) Are you
> gonna submit a patch, please? Since Stephan said it works as expected
> ...
You should admire Lukas, he suggested the solution :)
I'll fix that in CVS, ASAP.
Bertrand Mansion
Mamasam