Avatar of srikanth saladi
srikanth saladi

asked on 

how to add data to xml node value while parsing xml in php

Hi,

I need to add cdata to a node in an xml while parsing xml. I was unable to parse the content from that node. i had added CDATA by editing the xml, it worked fine and able to parse. But i need to add CDATA on the fly while parsing the xml and need to read that value as string.

Please find the xml node that needs to be added with cdata in the attached xml.

<Descriptionlongue>
<p><strong>Froid Ventilé Multi Air Flow</strong><br/><strong>Classe Energétique A+</strong><br/><strong>Affichage LED</strong><br/><br/></p> <table class="fridge-mini-spec" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td>Volume total net <span>(L)</span></td> <td>432</td> </tr><tr><td>Volume utile du réfrigérateur <span>(L)</span></td> <td>290 </td> </tr><tr><td>Volume utile du congélateur <span>(L)</span></td> <td>142</td> </tr><tr><td>Classe énergétique</td> <td>A+</td> </tr><tr><td>Largeur * Profondeur * Hauteur (cm)</td> <td>79*70*181</td> </tr><tr><td>Finition</td> <td>Métal brillant</td> </tr></tbody></table>
</Descriptionlongue>
RQ562N4AC1-fr-1-.xml
PHPXML* Parsing

Avatar of undefined
Last Comment
srikanth saladi

8/22/2022 - Mon