Jump to content

Updating/Altering XML with dynamic structure


Swapnil

Recommended Posts

Hi all,

 

I am new to PHP.

 

I want to update XML Node value, My XML is static and can be have different structure. I can get XMLNode name as "Assessments.Questions.Question[0].QuestionText" from client side application, and XML can look like.

 

<Assessments>

<Questions>

<Question>

<QuestionText>QuestionText 11111111</QuestionText>

<Options>

<Option><![CDATA[AAAAAAAAAAAAAAA]]></Option>

<Option><![CDATA[bBBBBBBBBBBBBBB]]></Option>

<Option><![CDATA[CCCCCCCCCCCCCCC]]></Option>

<Option><![CDATA[DDDDDDDDDDDDDDD]]></Option>

</Options>

</Question>

<Question>

<QuestionText>QuestionText 222222222</QuestionText>

<Options>

<Option><![CDATA[EEEEEEEEEEEEEEE]]></Option>

<Option><![CDATA[FFFFFFFFFFFFFFF]]></Option>

<Option><![CDATA[GGGGGGGGGGGGGGG]]></Option>

<Option><![CDATA[HHHHHHHHHHHHHHH]]></Option>

</Options>

</Question>

</Questions>

</Assessments>

 

User may select any node to edit and PHP will get updated nodeValue and nodeName.

 

Thanks in advance.

 

Regards,

Swapnil.

 

 

 

 

some attempted code would be nice.. lol,

 

not to be rude, but if you're looking for people to write a script for you, there is a freelance forum where people do exactly that.. but here we help with errors and problems.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.