Как я могу настроить xquery
ниже, чтобы результат был:
<?xml version="1.0" encoding="UTF-8"?><Sex>F</Sex>
xml:
<csv>
<record>
<entry>Reported_Date</entry>
<entry>HA</entry>
<entry>Sex</entry>
<entry>Age_Group</entry>
<entry>Classification_Reported</entry>
</record>
<record>
<entry>2020-01-26</entry>
<entry>Vancouver Coastal</entry>
<entry>M</entry>
<entry>40-49</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-02</entry>
<entry>Vancouver Coastal</entry>
<entry>F</entry>
<entry>50-59</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-05</entry>
<entry>Vancouver Coastal</entry>
<entry>F</entry>
<entry>20-29</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-05</entry>
<entry>Vancouver Coastal</entry>
<entry>M</entry>
<entry>30-39</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-11</entry>
<entry>Interior</entry>
<entry>F</entry>
<entry>30-39</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-20</entry>
<entry>Fraser</entry>
<entry>F</entry>
<entry>30-39</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-21</entry>
<entry>Fraser</entry>
<entry>M</entry>
<entry>40-49</entry>
<entry>Lab-diagnosed</entry>
</record>
<record>
<entry>2020-02-27</entry>
<entry>Vancouver Coastal</entry>
<entry>F</entry>
<entry>60-69</entry>
<entry>Lab-diagnosed</entry>
</record>
</csv>
xquery:
declare namespace map = "http://www.w3.org/2005/xpath-functions/map";
declare namespace array = "http://www.w3.org/2005/xpath-functions/array";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
for $x in /csv
return $x/record[3]/entry[3]
результат:
<?xml version="1.0" encoding="UTF-8"?><entry>F</entry>