AngieD
13 years agoOccasional Contributor
[Resolved] Need to reestablish XML sections
Hi. I have a large XML request that has several optional sections. I would like to create a loop that randomly removes sections and populates other sections. I am good with removing sections and populating sections, but on the next loop I am having problems reestablishing the sections that were removed with the previous loop.
Here is a sample of my XML. The first loop will have owner and feline information, so I want to remove the canine and exotic sections. The second loop will have the owner, canine and feline sections. But since the first loop removed the canine section I need to get it back. That is the big problem that I am having. I am using xmlHolder to set and remove the nodes. Is there some trick, similar to the "Recreates default request from schema" button, that will recreate the request adding back the removed sections? I've tried several strategies without success.
<vet>
<owner>
<ownerName></ownerName>
<address1></ownerName>
<address2></address2>
<city></city>
<state></state>
<zip></zip>
<phone1></phone1>
</owner>
<animal>
<canine>
<name></name>
<breed></breed>
</canine>
<feline>
<name></name>
<breed></breed>
</feline>
<exotic>
<name></name>
<type></type>
</exotic>
</animal>
</vet>
Thank you,
Angie
Here is a sample of my XML. The first loop will have owner and feline information, so I want to remove the canine and exotic sections. The second loop will have the owner, canine and feline sections. But since the first loop removed the canine section I need to get it back. That is the big problem that I am having. I am using xmlHolder to set and remove the nodes. Is there some trick, similar to the "Recreates default request from schema" button, that will recreate the request adding back the removed sections? I've tried several strategies without success.
<vet>
<owner>
<ownerName></ownerName>
<address1></ownerName>
<address2></address2>
<city></city>
<state></state>
<zip></zip>
<phone1></phone1>
</owner>
<animal>
<canine>
<name></name>
<breed></breed>
</canine>
<feline>
<name></name>
<breed></breed>
</feline>
<exotic>
<name></name>
<type></type>
</exotic>
</animal>
</vet>
Thank you,
Angie