Use doc() function to load xml docuCt : doc « XQuery « XML






Use doc() function to load xml docuCt


File: Data.xml


<order>
  <car dept="A">
    <number>1</number>
  </car>
  <car dept="B">
    <number>2</number>
  </car>
  <car dept="B">
    <number>3</number>
  </car>
  <car dept="C">
    <number>4</number>
  </car>
</order>


File: Query.xquery


doc("Data.xml")//number

Output:

<?xml version="1.0" encoding="UTF-8"?>
<number>1</number>
<number>2</number>
<number>3</number>
<number>4</number>

 








Related examples in the same category

1.doc() funciton in for loop
2.Use doc() function to load XML document
3.Load children