Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - xpath to return nodes [Thread Next] Re: xpath to return nodesTo: NULL Date: 12/1/2005 6:50:00 PM Use: //message[not(descendant::message)] In learning XPath the fun way, the XPath Visualizer is your friend. Cheers, Dimitre Novatchev <malauddin@g...> wrote in message news:1133416723.668250.129710@g...... > Hi everyone, > > In the xml below, can I use xpath to find the <message> node which do > not have any child <message> node. The conversion I am working, I have > to start from the child node and move up to the top node. There could > be multiple child nodes. Many thanks in advance. > > The xpath should give me the following node: > <message subject="attach 1.1"> > <message subject="attach 1.2"> > <message subject="attach 2.1"> > <message subject="attach 2.2"> > > ---------------------- > <message subject="Top level message"> > <attachments> > <attachment> > <message subject="attach 1.0"> > <attachments> > <attachment> > <message subject="attach 1.1"> > ....... > </message> > </attachment> > <attachment> > <message subject="attach 1.2"> > .... > </message> > </attachment> > </attachments> > </message> > </attachment> > <attachment> > <message subject="attach 2.0"> > <attachments> > <attachment> > <message subject="attach 2.1"> > </message> > </attachment> > <attachment> > <message subject="attach 2.2"> > </message> > </attachment> > </attachments> > </message> > </attachment> > > </attachments> > </message> > ---------------------------- > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
