Presentation is loading. Please wait.

Presentation is loading. Please wait.

XQuery Leah Andrews. Overview  Queries data stored in XML trees  Declarative  High-level  Functional (no side effects)  Strongly typed  Nodes 

Similar presentations


Presentation on theme: "XQuery Leah Andrews. Overview  Queries data stored in XML trees  Declarative  High-level  Functional (no side effects)  Strongly typed  Nodes "— Presentation transcript:

1 XQuery Leah Andrews

2 Overview  Queries data stored in XML trees  Declarative  High-level  Functional (no side effects)  Strongly typed  Nodes  Atomic values (integers, strings, booleans)

3 Origins  Became a W3 standard in January, 2007  Developed by Jonathan Robie, Don Chamberlin and Daniela Florescu  Compatible with other W3 standards  XML (namespaces, Schema), XSLT, XPath

4 XQuery v. XSLT  Overlapping capabilities  Share a data model, type system, function library and XPath

5 XQuery > XSLT  Better usability  More concise  Other languages can be embedded  More Orthogonal  Can be expressed in XML syntax (XQueryX)

6 XSLT > XQuery  Better for small-scale changes to XML documents  Widespread use  More flexible for transformations

7 XQuery does NOT support:  Full text search capacity  Updating XML documents or databases  Dynamic typing  Polymorphism

8 FLWOR  FOR  LET  WHERE  ORDER BY  RETURN

9 1 MacBook olive 2 WinBook orange 3 Toshiba orange 4 Gateway green 5 Asus rainbow 6 ZT black 7 IMB unknown 8 MacBook German

10 xquery version "1.0"; All students { for $x in doc("students.xml")/class/students order by $x/studentId return { $x } }

11 xquery version "1.0"; Students with an id less than 5 { for $x in doc("students.xml")/class/students where $x/studentId<5 order by $x/studentId return {data($x/@name)} }

12 xquery version "1.0"; Favorite (student) colors { for $x in doc("students.xml")/class/students/favoritecolor return {data($x)} }


Download ppt "XQuery Leah Andrews. Overview  Queries data stored in XML trees  Declarative  High-level  Functional (no side effects)  Strongly typed  Nodes "

Similar presentations


Ads by Google