Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,19 @@
(:
1. Retrieve the first "item" element
Notice the braces around //item. This evaluates first all item elements and then retrieving the first one.
Whithout the braces you get the first item for every section.
:)
let $firstItem := (//item)[1]
(: 2. Perform an action on each "price" element (print it out) :)
let $price := //price/data(.)
(: 3. Get an array of all the "name" elements :)
let $names := //name
return
<result>
<firstItem>{$firstItem}</firstItem>
<prices>{$price}</prices>
<names>{$names}</names>
</result>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<result>
<firstItem>
<item upc="123456789" stock="12">
<name>Invisibility Cream</name>
<price>14.50</price>
<description>Makes you invisible</description>
</item>
</firstItem>
<prices>14.50 23.99 4.95 3.56</prices>
<names>
<name>Invisibility Cream</name>
<name>Levitation Salve</name>
<name>Blork and Freen Instameal</name>
<name>Grob winglets</name>
</names>
</result>