Hai Liam Thank you for the reply. Thank u for letting me know an alternative for this. But there is a problem with what you have sent. It is not just removing of the bottom group tag that is required.
If you check the input then u can find out that the title Commentary has 3 sub tags Letters, Books et al. and Policy Forum and under the tag Policy Forum u can find one more sub tag Policy Forum1 like this it can continue. what ever output which u have given will not give me the exact format of output that is required. Any way thank u for the help Reagrds Chaitanya On Sat, Dec 18, 2010 at 12:06 PM, Liam R E Quin <l...@w3.org> wrote: > On Sat, 2010-12-18 at 10:50 +0530, Chaitanya Yanamadala wrote: > > Hai > > I have a new challenge based on the XML. I have tried with various > > combination s but could not able to resolve it. So i request you guys to > > help me out on this. > > I think the first question is, why are you using Perl for this? > > The next is, how is the output to be derived from the input? > It looks as if you're removing the lowest-level "group" element, > and where there are two consecutive title elements you use only > the second. > > If that's right, the following XSLT will do it. > > On Linux, *BSD, Solaris, OS X etc, you can use > xsltproc try.xsl try.xml > output.xml > You can also access XSLT from within Perl of course. > > I did not bother with the whitespace and CDATA sections you used. > > Liam > > > > -- > Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/ > Pictures from old books: http://fromoldbooks.org/ > Ankh: irc.sorcery.net irc.gnome.org www.advogato.org >