Xml Question?

  • Thread starter Thread starter Raed Sawalha
  • Start date Start date
R

Raed Sawalha

Dear :
I have XML with following structure: saved with name report.xml
<Report>
<!-- Part (1) -->
<Client ID="1" IP="">
<!-- Part (2) -->
<Date></Date>
<Statistics>
<Pearsons></Pearsons>
<ComfortValue></ComfortValue>
<RequestedURLs>
<URL>
<Number></Number>
<Path></Path>
</URL>
</RequestedURLs>
</Statistics>
<BlockReason></BlockReason>
<!--End Of Part (2) -->
</Client>
<!-- End Of Part (1) -->
</Report>

the part(1) section will be generated by code as string with XML format , so if the ID in Client Tag is equal to ID in Client Tag generated in string is equal (already did the code for this ) I need to append the part(2) information under Client Tag , else(the ID for client does not exist) add the string generated in new client tag with new ID.
I need to know how to do this procedure ,which adding after specific Node the Xml String.

i.e. : fileExist->yes->loadXML->isClient already added->yes->append information( the information already generated in string format)
fileExist->yes->loadXML->IsClient already added->no-> add new client tag with his ID


Regards
 
Back
Top