Need help flatten children with specific name at any level in the XML to the root element



Need help flatten children with specific name (Folder,NNode,Wfm,EveryPage, Page, AreaMain) at any level in the XML to the PrintRoot element


Here is my sample xml, file is very large ways to flatten and and load it into SQL, Any C# or XSLT sample is appreciated.


or is there any ways to process the file, the difficulties here is the hierarchy and structure are very dynamic and changes every time.



<PrintRoot des="Print Extract" ver="19">
<Templates>
<Template No="1" des="SOME TEXT1"/>
</Templates>
<Folder>
<NNode des="SOME TEXT2">
<Type>Menu_r</Type>
<key>
<area>0</area>
<program>1</program>
<line>10</line>
</key>
<NNode des="COVER SHEET">
<u>
<Des>COVER SHEET</Des>
<v>
<request>0</request>
</v>
</u>
<ConditionSyntax>
<summary>IF (IF SELECTED )</summary>
</ConditionSyntax>
<ConditionFormula des="IF (IF SELECTED )">
<Type>T</Type>
</ConditionFormula>
<Page des=" COVER SHEET">
<Type>Menu_r</Type>
<u>
<Des>Junk</Des>
</u>
<wmf des="9SPSCV T">
<display>TEST MESSAGE</display>
</wmf>
</Page>
</NNode>
</NNode>
<EveryPage des="EVERY FORM PAGE"/>
<NNode des="5500">
<wp>12313213</wp>
<key>
<area>0</area>
<program>1</program>
<line>64</line>
</key>
<AreaMain Area="006">
<TypeDesc>Menu - Print request</TypeDesc>
</AreaMain>
<NNode des="5500">
<wp>12313213</wp>
<key>
<area>0</area>
<program>1</program>
<line>64</line>
</key>
<AreaMain Area="006">
<TypeDesc>Menu - Print request</TypeDesc>
</AreaMain>
</NNode>
</NNode>
</Folder>
</PrintRoot>

No comments:

Post a Comment