D
Duane Morin
Ok, I've got a situation where I have an XML that looks something like
this:
<A>
<B>
<C/>
</B>
<D>
<C/>
</D>
<E>
</E>
</A>
....
basically the relevant descriptor is "There are some instances of <C>
in the file in non-easily predictable spots."
What I want to do is transform this file so that it looks like this:
<A>
<B>
<C/><MyTag/>
</B>
<D>
<C/><MyTag/>
</D>
...
In other words "Find all <C> tags and insert <MyTag> after it."
I am at a loss as to how to do this. I can get the "Find all C's and
do this afterward..." but how to I say "And leave the rest of the file
exactly as it is?" Can I even do that? Do I have to explicitly say
"Find A, write A, find B, write B...find C, write C and then write
MyTag...."?? That can't be right, can it?
this:
<A>
<B>
<C/>
</B>
<D>
<C/>
</D>
<E>
</E>
</A>
....
basically the relevant descriptor is "There are some instances of <C>
in the file in non-easily predictable spots."
What I want to do is transform this file so that it looks like this:
<A>
<B>
<C/><MyTag/>
</B>
<D>
<C/><MyTag/>
</D>
...
In other words "Find all <C> tags and insert <MyTag> after it."
I am at a loss as to how to do this. I can get the "Find all C's and
do this afterward..." but how to I say "And leave the rest of the file
exactly as it is?" Can I even do that? Do I have to explicitly say
"Find A, write A, find B, write B...find C, write C and then write
MyTag...."?? That can't be right, can it?