Click here to Skip to main content
15,891,900 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i am new to xml doc stuff :-) hope u can help me. below is my scenario.

input
XML
<fn-group>
<fn id="1"><p>For example, the <format>sixteenth-century</format> cow</p>
<p>Other new seventeenth-century cow</p>
<p>this is my text</p></fn>
<fn id="2"><p>For example, the sixteenth-century cow</p>
<p>Other new seventeenth-century cow</p>
<p>this is my text</p></fn>
<fn-group>



VB
[condition]
if the <fn> tag contains <format> tag then the whole <fn> should be replicated right after



expected output:
XML
<fn-group>
<fn id="1"><p>For example, the <format>sixteenth-century</format> cow</p>
<p>Other new seventeenth-century cow</p>
<p>this is my text</p></fn>
<fn id="1"><p>For example, the <format>sixteenth-century</format> cow</p>
<p>Other new seventeenth-century cow</p>
<p>this is my text</p></fn>
<fn id="2"><p>For example, the sixteenth-century cow</p>
<p>Other new seventeenth-century cow</p>
<p>this is my text</p></fn>
<fn-group>


Thanks,
Chaegie
Posted

1 solution

I believe that using XSLT templates could solve your problem.
 
Share this answer
 
Comments
Chaegie 13-Jun-10 4:09am    
Thanks for the reply but i need to use xml document for the reason that the rest of the code uses xml document. This is an existing application and i need to change due to some request.
[no name] 13-Jun-10 5:26am    
I can't see any problem to do the tranform in memory and then load the result into XmlDocument.It's always possible unless your document is huge one.I that case you could use temporary files.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900