[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] extracting and removing an element nested at different levels


Subject: [xsl] extracting and removing an element nested at different levels
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Tue, 4 Sep 2012 14:56:26 -0700

I have XML consisting of <Item> elements that have nested <Item> elements at various depths within the tree, in its simplest form something like:

<List>
   <Item>
       <ElementA>
           <Item>
               <ElementB/>
           </Item>
       </ElementA>
   </Item>
</List>

That I want to render as:

<List>
   <Item>
       <ElementA/>
   </Item>
   <Item>
       <ElementB/>
   </Item>
</List>

Is there a general technique I can use to remove nested <Item> elements whatever their depth and place all <Item> elements at the same level within the <List>?
Thanks,
Mark



Current Thread
Keywords
xml