xml - XPATH Help to select multiple instances of the same elements -


i using tool allows xpath expressions fetch information presentation , selection... given xml (below) file intput, trying determine xpath select , return multiple artists based on on title , country selected

so fetch country:

 row:   //catalog/cd/country[not(. = ../following-sibling;;cd/country)]  column: ---- 

then fetch title:

 row:   //catalog/cd[contains(./country,'${cdcountry.value}')]  column:  ./title 

and fetch artists:

  row:  //catalog/cd[contains(./title,'${cdtitle.value}')]   column: ./artist 

xml file

<?xml version="1.0" encoding="utf-8"?> <catalog>     <cd>         <title>title1</title>         <artist>beatles</artist>         <country>uk</country>         <company>columbia</company>         <price>10.90</price>         <year>1985</year>     </cd>     <cd>         <title>title2</title>         <artist>bonnie tyler</artist>         <artist>taylor swift</artist>         <artist>beastie boys</artist>         <country>us</country>         <company>cbs records</company>         <price>9.90</price>         <year>1988</year>     </cd>     <cd>         <title>title3</title>         <artist>eros ramazzotti</artist>         <country>it</country>         <company>bmg</company>         <price>9.90</price>         <year>1997</year>     </cd> </catalog> 


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -