I am trying to transform a pretty complex XML file to XML via XSLT so it will be a replica of the previous XML document only with the second grandchild node excluded in the output. Hoping there is an easy solution using XSLT.
Here is a sample of the XML I'm trying to transform:
<cases>
<Parent>
<text1>Text1</text1>
<text2>Text2</text2>
<text3>Text3</text3>
<Child_node>
<Grandchild_node>
<gctext1>Sample text 1</gctext1>
<gctext2>Sample text 2</gctext2>
<gctext3>Sample text 3</gctext3>
<Great_grandchild_node>
<ggctext1>Great grandchild text 1</ggctext1>
</Great_grandchild_node>
</Grandchild_node>
<Grandchild_node>
<gctext1>More Sample text 1</gctext1>
<gctext2>Different Sample text 2</gctext2>
<gctext3>More Sample text 3</gctext3>
<Great_grandchild_node>
<ggctext1>Great grandchild text 2</ggctext1>
</Great_grandchild_node>
</Grandchild_node>
</Child_node>
</Parent>
</cases>
I want the output to display everything but the info contained in the second Grandchild_node. Example of output I want to achieve:
<cases>
<Parent>
<text1>Text1</text1>
<text2>Text2</text2>
<text3>Text3</text3>
<Child_node>
<Grandchild_node>
<gctext1>Sample text 1</gctext1>
<gctext2>Sample text 2</gctext2>
<gctext3>Sample text 3</gctext3>
<Great_grandchild_node>
<ggctext1>Great grandchild text 1</ggctext1>
</Great_grandchild_node>
</Grandchild_node>
</Child_node>
</Parent>
</cases>
Any help would be appreciated.
Grandchild_node. The answer by @TimC is the correct one. Please, accept the correct answer.Grandchild_node[5]-isn't this strange?