File: Data.xml
0001
name 1
0002
name 2
0003
name 3
File: Query.xquery
element html {
element h1 { "car order" },
element ul {
for $prod in doc("Data.xml")/order/car
return element li {"id:",data($prod/id),", name:",data($prod/name)}
}
}
Output:
car order
- id: 0001 , name: name 1
- id: 0002 , name: name 2
- id: 0003 , name: name 3