Monthly Archives: March 2013

Let’s Learn XQuery [Part1: Overview]

XQuery is is query and functional programming language designed to query XML data like SQL from database. XQuery version 1.0 was developed by a group within W3C [http://en.wikipedia.org/wiki/W3C]

Using XQuery, we can read/write/update data to/from XML documents or any data source that can be viewed as XML. XPath is closely related to XQuery as this is used in XQuery expressions to retreive specific parts of XML.

XQuery is based on the XQuery and XPath Data Model (XDM) which uses a tree-structured model which is composed of various parts as depicted in the below picture.

 

photo

The XML declaration and encoding where you declare the XML version and encoding

  1. The xml document contains Root Element, Child elements and attributes.
  2. root element for any XML. You don’t have to go with “root” as name. Your name is also ok in XML as XML is very open.
  3. Any level of nested sub elements is possible. In the picture, I have showed 3 levels only.
  4. attributes can be tagged to any element of XML structure.

Below are some areas where XQuery is heavily used:

  1. XML Parsing 
  2. XML Transformation
  3. System Integration
  4. Many COTS products – (ex. OSM as a core programming and customization language)

 

This is very basic introduction for XQuery and XML for setting the context. More details about XML and XQuery can be found at “http://en.wikipedia.org/wiki/XQuery” and “http://www.w3schools.com/xquery/default.asp”.

Advertisements