How to select all tags until a certain tag
Posted: Wed Apr 13, 2011 11:20 am
Hi,
I have the following XML:
I need to have the following output:
So all H and P tag belong together until another H tag is received.
Consequentiality all H tag belong together and all P tag should be grouped together.
Until now I didn't find a correct way to handle it yet.
Anybody having an idea on how to handle this in xslt?
regards,
I have the following XML:
Code: Select all
<root>
<H>1-A</H>
<H>1-B</H>
<P></P>
<P></P>
<P></P>
<H>2-A</H>
<P></P>
<P></P>
<H>3-A</H>
<H>3-B</H>
<H>3-C</H>
<P></P>
</root>
Code: Select all
<R>
<RECORD>
<SOMETAG>
<H>1-A</H>
<H>1-B</H>
</SOMETAG>
<ANOTHER>
<P></P>
<P></P>
</ANOTHER>
</RECORD>
<RECORD>
<SOMETAG>
<H>2-A</H>
</SOMETAG>
<ANOTHER>
<P></P>
<P></P>
<P></P>
</ANOTHER>
</RECORD>
<RECORD>
<SOMETAG>
<H>3-A</H>
<H>3-B</H>
<H>3-C</H>
</SOMETAG>
<SOMETAG1>
<P></P>
</SOMETAG1>
</RECORD>
</R>
Consequentiality all H tag belong together and all P tag should be grouped together.
Until now I didn't find a correct way to handle it yet.
Anybody having an idea on how to handle this in xslt?
regards,