Re: xml parsing
| From: | Robert Cummings | Date: | Mon, 12 Mar 2007 01:24:22 +0000 |
| Subject: | Re: xml parsing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-250263@lists.php.net to get a copy of this message | ||
On Mon, 2007-03-12 at 01:38 +0100, Marije van Deventer wrote:
> I have been trying to parse this xml, and want to use it with
> childnodes <Label> and <Tekst>, but sofar due to the <li> and
> <p> and <image> elements no luck. How can i do this in a simple
> way ???
You're having trouble because the person who set the content of <Tekst>
didn't have a clue and so didn't mark up special entities. As such, the
XML has now taken on a mixed structure of XML and HTML.
You might have success performing the following before trying to parse:
<?php
$xml = str_replace( '<Tekst>', '<Tekst><![CDATA[', $xml );
$xml = str_replace( '</Tekst>', ']]></Tekst>', $xml );
?>
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'