Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: complex selection >Thread Next - Re: complex selection Re: complex selectionTo: NULL Date: 2/6/2008 5:35:00 AM On Feb 6, 2:30=A0pm, Martin Honnen <mahotr...@yahoo.de> wrote: > khalil...@hotmail.com wrote: > > Can anyone help me make the following selection? > > For element which has a tag3 value "fr" choose tag4 value concatenated > > with the value of tag4 value for the element whose tag3 is "nl" > > > If tag4 is missing (for "fr" or "nl") then choose tag5 value > > What kind of solution are you looking for? > > Here is an XQuery solution: > > let $doc :=3D doc('input.xml') > let $fr :=3D $doc/tag1/tag2[tag3 =3D 'fr'] > let $nl :=3D $doc/tag1/tag2[tag3 =3D 'nl'] > return concat(($fr/tag4, $fr/tag5)[1], ' ', ($nl/tag4, $nl/tag5)[1]) > > You can use XQuery with Saxon 9 from <URL:http://saxon.sourceforge.net/> > or with Altova XML tools from <URL:http://www.altova.com/altovaxml.html> > -- > > =A0 =A0 =A0 =A0 Martin Honnen --- MVP XML > =A0 =A0 =A0 =A0http://JavaScript.FAQTs.com/ thanks Martin I forgot to specify that i need an XSL solution Mahmoud | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
