XQuery and element : node « XQuery « XML

Home
XML
1.CSS Style
2.SVG
3.XML Schema
4.XQuery
5.XSLT stylesheet
XML » XQuery » node 
XQuery and element


File: Data.xml
<?xml version="1.0"?>
<Books>
 <Book>A</Book>
 <Book>B</Book>
 <Book>C</Book>
</Books>

File: Query.xquery

<Books>
{doc("Data.xml")/Books/Book}
</Books>

Output:

<?xml version="1.0" encoding="UTF-8"?>
<Books>
   <Book>A</Book>
   <Book>B</Book>
   <Book>C</Book>
</Books>

 
Related examples in the same category
1.Select element by level
2.Query from root element
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.