xml dosyasını ayrıştırma zaman html içeriği korumak

0 Cevap php

Ben bir xml dosyası var

<text>
    <defalut>This file has the following features:</defalut>
    <value>
        <ul>
            <li><info>CSS text formatting </info></li>
            <li><info>Text loaded from a XML</info></li>
            <li><info>Scrolls with easing</info></li>
            <li><info>Mouse wheel supported</info></li>
            <li><info>HTML supported</info></li>
            <li><info>Click on the bar to move  the handle to that point</info></li>
            <li><info>Supports images</info></li>
            <li><info>The scrollbar hides if not needed</info></li>
            <li><info>The scrollbar resizes proportonal to the text sizeq</info></li>
        </ul>
    </value>
    <tittle>Lorem Ipsum</tittle>
</text>

Ben bu dosyayı ayrıştırmak için XPath ve XQuery kullanıyorum

$xml_str1 = file_get_contents("file.xml");
echo $xml_str = $xml_str.$xml_str1;
$xml = simplexml_load_string($xml_str);
$nodes = $xml->xpath('//text');

but iam getting the string only. How can i preserve the html tags in the result if iam parsing <value> tag i am getting the content without <ul> and <li> How can i get the full html content in the <value> tag as it is

Şimdiden teşekkürler

0 Cevap