Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - complex selection >Thread Next - Re: complex selection Re: complex selectionTo: NULL Date: 2/6/2008 2:31:00 PM khalil_mi@h... 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 := doc('input.xml') let $fr := $doc/tag1/tag2[tag3 = 'fr'] let $nl := $doc/tag1/tag2[tag3 = '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> -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
