J'ai un fichier xmlpréserver le contenu HTML lors de l'analyse du fichier xml
<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>
J'utilise XPath et XQuery pour analyser ce fichier
$xml_str1 = file_get_contents("file.xml");
echo $xml_str = $xml_str.$xml_str1;
$xml = simplexml_load_string($xml_str);
$nodes = $xml->xpath('//text');
mais iam obtenir que la chaîne. Comment puis-je conserver les balises HTML dans le résultat si iam tag parsing <value>
Je reçois le contenu sans <ul>
et <li>
Comment puis-je obtenir le plein contenu html dans la balise <value>
comme il est
Merci à l'avance
lorsque j'ai essayé $ xml_str1 = file_get_contents ($ file); $ xml_str = $ xml_str. $ Xml_str1; $ xml = simplexml_load_string ($ xml_str); $ nodes = $ xml-> xpath ('// text'); reçois le résultat Tableau ( [0] => SimpleXMLElement Object ( [defalut] => Ce fichier présente les caractéristiques suivantes: [valeur] => SimpleXMLElement Object ( ) [Tittle] = > Lorem Ipsum ) ) – Warrior
obtenir la valeur comme nulle – Warrior
Quelle solution avez-vous essayé? –