Misplaced Pages

XQuery

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

XQuery ( XML Query ) is a query and functional programming language that queries and transforms collections of structured and unstructured data , usually in the form of XML , text and with vendor-specific extensions for other data formats ( JSON , binary , etc.). The language is developed by the XML Query working group of the W3C . The work is closely coordinated with the development of XSLT by the XSL Working Group; the two groups share responsibility for XPath , which is a subset of XQuery.

#271728

54-583: XQuery 1.0 became a W3C Recommendation on January 23, 2007. XQuery 3.0 became a W3C Recommendation on April 8, 2014. XQuery 3.1 became a W3C Recommendation on March 21, 2017. "The mission of the XML Query project is to provide flexible query facilities to extract data from real and virtual documents on the World Wide Web, therefore finally providing the needed interaction between the Web world and

108-605: A Recommendation in early 2007; as a result, XSLT is still much more widely used. Both languages have similar expressive power, though XSLT 2.0 has many features that are missing from XQuery 1.0, such as grouping, number and date formatting, and greater control over XML namespaces. Many of these features were planned for XQuery 3.0. Any comparison must take into account the version of XSLT. XSLT 1.0 and XSLT 2.0 are very different languages. XSLT 2.0, in particular, has been heavily influenced by XQuery in its move to strong typing and schema-awareness. Usability studies have shown that XQuery

162-455: A common approach where appropriate. They share the same data model ( XDM ), type system, and function library, and both include XPath 2.0 as a sublanguage. The two languages, however, are rooted in different traditions and serve the needs of different communities. XSLT was primarily conceived as a stylesheet language whose primary goal was to render XML for the human reader on screen, on the web (as web template language ), or on paper. XQuery

216-753: A community of major web players and publishers to establish a MediaWiki wiki that seeks to document open web standards called the WebPlatform and WebPlatform Docs. In January 2013, Beihang University became the Chinese host. In 2022 the W3C WebFonts Working Group won an Emmy Award from the National Academy of Television Arts and Sciences for standardizing font technology for custom downloadable fonts and typography for web and TV devices. On 1 January 2023, it reformed as

270-493: A community of major web players and publishers to establish a MediaWiki wiki that seeks to document open web standards called the WebPlatform and WebPlatform Docs. In January 2013, Beihang University became the Chinese host. In 2022 the W3C WebFonts Working Group won an Emmy Award from the National Academy of Television Arts and Sciences for standardizing font technology for custom downloadable fonts and typography for web and TV devices. On 1 January 2023, it reformed as

324-654: A full query saying 'Hello World', one writes the expression: This style is common in functional programming languages . Below are a few examples of how XQuery can be used: Although XQuery was initially conceived as a query language for large collections of XML documents, it is also capable of transforming individual documents. As such, its capabilities overlap with XSLT , which was designed expressly to allow input XML documents to be transformed into HTML or other formats. The XSLT 2.0 and XQuery standards were developed by separate working groups within W3C , working together to ensure

378-610: A new edition or level of the recommendation. Additionally, the W3C publishes various kinds of informative notes which are to be used as references. Unlike the Internet Society and other international standards bodies, the W3C does not have a certification program. The W3C has decided, for now, that it is not suitable to start such a program, owing to the risk of creating more drawbacks for the community than benefits. In January 2023, after 28 years of being jointly administered by

432-495: A new edition or level of the recommendation. Additionally, the W3C publishes various kinds of informative notes which are to be used as references. Unlike the Internet Society and other international standards bodies, the W3C does not have a certification program. The W3C has decided, for now, that it is not suitable to start such a program, owing to the risk of creating more drawbacks for the community than benefits. In January 2023, after 28 years of being jointly administered by

486-544: A processing pipeline. The use of XML syntax also enables the use of XML-based tools for managing XSLT code. By contrast, XQuery syntax is more suitable for embedding in traditional programming languages such as Java (see XQuery API for Java ) or C# . If necessary, XQuery code can also be expressed in an XML syntax called XQueryX. The XQueryX representation of XQuery code is rather verbose and not convenient for humans, but can easily be processed with XML tools, for example transformed with XSLT stylesheets. Two major extensions to

540-462: A public-interest 501(c)(3) non-profit organization . W3C develops technical specifications for HTML5 , CSS , SVG , WOFF , the Semantic Web stack , XML , and other technologies. Sometimes, when a specification becomes too large, it is split into independent modules that can mature at their own pace. Subsequent editions of a module or specification are known as levels and are denoted by

594-402: A public-interest 501(c)(3) non-profit organization . W3C develops technical specifications for HTML5 , CSS , SVG , WOFF , the Semantic Web stack , XML , and other technologies. Sometimes, when a specification becomes too large, it is split into independent modules that can mature at their own pace. Subsequent editions of a module or specification are known as levels and are denoted by

SECTION 10

#1732775259272

648-597: A set of core principles and components that are chosen by the consortium. It was originally intended that CERN host the European branch of W3C; however, CERN wished to focus on particle physics , not information technology . In April 1995, the French Institute for Research in Computer Science and Automation became the European host of W3C, with Keio University Research Institute at SFC becoming

702-408: A set of core principles and components that are chosen by the consortium. It was originally intended that CERN host the European branch of W3C; however, CERN wished to focus on particle physics , not information technology . In April 1995, the French Institute for Research in Computer Science and Automation became the European host of W3C, with Keio University Research Institute at SFC becoming

756-449: A single item only. No distinction is made between a single item and a singleton sequence. (...) XQuery/XPath sequences differ from lists in languages like Lisp and Prolog by excluding nested sequences. Designers of XQuery may have considered nested sequences unnecessary for the manipulation of document contents. Nesting, or hierarchy of document structures is instead represented by nodes and their child-parent relationships XQuery provides

810-462: A working draft (WD) for review by the community. A WD document is the first form of a standard that is publicly available. Commentary by virtually anyone is accepted, though no promises are made with regard to action on any particular element commented upon. At this stage, the standard document may have significant differences from its final form. As such, anyone who implements WD standards should be ready to significantly modify their implementations as

864-462: A working draft (WD) for review by the community. A WD document is the first form of a standard that is publicly available. Commentary by virtually anyone is accepted, though no promises are made with regard to action on any particular element commented upon. At this stage, the standard document may have significant differences from its final form. As such, anyone who implements WD standards should be ready to significantly modify their implementations as

918-599: Is an extension of XQuery that adds support to extract and transform data from JSON documents. JSONiq is a superset of XQuery 3.0. It is published under the Creative Commons Attribution-ShareAlike 3.0 license. XQuery 3.1 de facto deprecates JSONiq as it has added full support for JSON. The EXQuery project develops standards around creating portable XQuery applications. The following standards are currently available: W3C Recommendation The World Wide Web Consortium ( W3C )

972-554: Is based on the XQuery and XPath Data Model (XDM) which uses a tree-structured model of the information content of an XML document, containing seven kinds of nodes: document nodes, elements, attributes, text nodes, comments, processing instructions, and namespaces. XDM also models all values as sequences (a singleton value is considered to be a sequence of length one). The items in a sequence can either be XML nodes or atomic values. Atomic values may be integers, strings, Booleans, and so on:

1026-574: Is currently stronger than XQuery for applications that involve making small changes to a document (for example, deleting all the NOTE elements). Such applications are generally handled in XSLT by use of a coding pattern that involves an identity template that copies all nodes unchanged, modified by specific templates that modify selected nodes. XQuery has no equivalent to this coding pattern, though in future versions it will be possible to tackle such problems using

1080-403: Is done by external experts in the W3C's various working groups. The Consortium is governed by its membership. The list of members is available to the public. Members include businesses, nonprofit organizations, universities, governmental entities, and individuals. Membership requirements are transparent except for one requirement: An application for membership must be reviewed and approved by

1134-403: Is done by external experts in the W3C's various working groups. The Consortium is governed by its membership. The list of members is available to the public. Members include businesses, nonprofit organizations, universities, governmental entities, and individuals. Membership requirements are transparent except for one requirement: An application for membership must be reviewed and approved by

SECTION 20

#1732775259272

1188-500: Is easier to learn than XSLT , especially for users with previous experience of database languages such as SQL. This can be attributed to the fact that XQuery is a smaller language with fewer concepts to learn, and to the fact that programs are more concise. It is also true that XQuery is more orthogonal, in that any expression can be used in any syntactic context. By contrast, XSLT is a two-language system in which XPath expressions can be nested in XSLT instructions but not vice versa. XSLT

1242-417: Is named: FOR, LET, WHERE, ORDER BY, RETURN. The language also provides syntax allowing new XML documents to be constructed. Where the element and attribute names are known in advance, an XML-like syntax can be used; in other cases, expressions referred to as dynamic node constructors are available. All these constructs are defined as expressions within the language, and can be arbitrarily nested. The language

1296-555: Is now endorsed by the W3C, indicating its readiness for deployment to the public, and encouraging more widespread support among implementors and authors. Recommendations can sometimes be implemented incorrectly, partially, or not at all, but many standards define two or more levels of conformance that developers must follow if they wish to label their product as W3C-compliant. A recommendation may be updated or extended by separately-published, non-technical errata or editor drafts until sufficient substantial edits accumulate for producing

1350-555: Is now endorsed by the W3C, indicating its readiness for deployment to the public, and encouraging more widespread support among implementors and authors. Recommendations can sometimes be implemented incorrectly, partially, or not at all, but many standards define two or more levels of conformance that developers must follow if they wish to label their product as W3C-compliant. A recommendation may be updated or extended by separately-published, non-technical errata or editor drafts until sufficient substantial edits accumulate for producing

1404-505: Is the main international standards organization for the World Wide Web . Founded in 1994 and led by Tim Berners-Lee , the consortium is made up of member organizations that maintain full-time staff working together in the development of standards for the World Wide Web. As of 5 March 2023, W3C had 462 members. W3C also engages in education and outreach, develops software and serves as an open forum for discussion about

1458-571: Is the version of a standard that has passed the prior two levels. The users of the standard provide input. At this stage, the document is submitted to the W3C Advisory Council for final approval. While this step is important, it rarely causes any significant changes to a standard as it passes to the next phase. This is the most mature stage of development. At this point, the standard has undergone extensive review and testing, under both theoretical and practical conditions. The standard

1512-499: Is the version of a standard that has passed the prior two levels. The users of the standard provide input. At this stage, the document is submitted to the W3C Advisory Council for final approval. While this step is important, it rarely causes any significant changes to a standard as it passes to the next phase. This is the most mature stage of development. At this point, the standard has undergone extensive review and testing, under both theoretical and practical conditions. The standard

1566-525: The Electronic Frontier Foundation 's resignation from W3C. As feared by the opponents of EME, as of 2020 , none of the widely used Content Decryption Modules used with EME are available for licensing without a per-browser licensing fee. W3C/ Internet Engineering Task Force standards (over Internet protocol suite ): W3C The World Wide Web Consortium ( W3C ) is the main international standards organization for

1620-1040: The MIT Computer Science and Artificial Intelligence Laboratory (located in Stata Center ) in the United States, the (in Sophia Antipolis , France), Keio University (in Japan) and Beihang University (in China), the W3C incorporated as a legal entity, becoming a public-interest not-for-profit organization . The W3C has a staff team of 70–80 worldwide as of 2015 . W3C is run by a management team which allocates resources and designs strategy, led by CEO Jeffrey Jaffe (as of March 2010), former CTO of Novell . It also includes an advisory board that supports strategy and legal matters and helps resolve conflicts. The majority of standardization work

1674-676: The MIT Computer Science and Artificial Intelligence Laboratory (located in Stata Center ) in the United States, the (in Sophia Antipolis , France), Keio University (in Japan) and Beihang University (in China), the W3C incorporated as a legal entity, becoming a public-interest not-for-profit organization . The W3C has a staff team of 70–80 worldwide as of 2015 . W3C is run by a management team which allocates resources and designs strategy, led by CEO Jeffrey Jaffe (as of March 2010), former CTO of Novell . It also includes an advisory board that supports strategy and legal matters and helps resolve conflicts. The majority of standardization work

XQuery - Misplaced Pages Continue

1728-434: The World Wide Web . Founded in 1994 and led by Tim Berners-Lee , the consortium is made up of member organizations that maintain full-time staff working together in the development of standards for the World Wide Web. As of 5 March 2023, W3C had 462 members. W3C also engages in education and outreach, develops software and serves as an open forum for discussion about the Web. The World Wide Web Consortium (W3C)

1782-686: The Asian host in September 1996. Starting in 1997, W3C created regional offices around the world. As of September 2009, it had eighteen World Offices covering Australia, the Benelux countries (Belgium, Netherlands and Luxembourg), Brazil, China, Finland, Germany, Austria, Greece, Hong Kong, Hungary, India, Israel, Italy, South Korea, Morocco, South Africa, Spain, Sweden, and, as of 2016, the United Kingdom and Ireland. In October 2012, W3C convened

1836-459: The Asian host in September 1996. Starting in 1997, W3C created regional offices around the world. As of September 2009, it had eighteen World Offices covering Australia, the Benelux countries (Belgium, Netherlands and Luxembourg), Brazil, China, Finland, Germany, Austria, Greece, Hong Kong, Hungary, India, Israel, Italy, South Korea, Morocco, South Africa, Spain, Sweden, and, as of 2016, the United Kingdom and Ireland. In October 2012, W3C convened

1890-453: The W3C started considering adding DRM -specific Encrypted Media Extensions (EME) to HTML5 , which was criticised as being against the openness, interoperability, and vendor neutrality that distinguished websites built using only W3C standards from those requiring proprietary plug-ins like Flash . On 18 September 2017, the W3C published the EME specification as a recommendation, leading to

1944-404: The W3C started considering adding DRM -specific Encrypted Media Extensions (EME) to HTML5 , which was criticised as being against the openness, interoperability, and vendor neutrality that distinguished websites built using only W3C standards from those requiring proprietary plug-ins like Flash . On 18 September 2017, the W3C published the EME specification as a recommendation, leading to

1998-522: The W3C. Many guidelines and requirements are stated in detail, but there is no final guideline about the process or standards by which membership might be finally approved or denied. The cost of membership is given on a sliding scale, depending on the character of the organization applying and the country in which it is located. Countries are categorized by the World Bank 's most recent grouping by gross national income per capita. In 2012 and 2013,

2052-464: The W3C. Many guidelines and requirements are stated in detail, but there is no final guideline about the process or standards by which membership might be finally approved or denied. The cost of membership is given on a sliding scale, depending on the character of the organization applying and the country in which it is located. Countries are categorized by the World Bank 's most recent grouping by gross national income per capita. In 2012 and 2013,

2106-836: The Web. The World Wide Web Consortium (W3C) was founded in 1994 by Tim Berners-Lee after he left the European Organization for Nuclear Research ( CERN ) in October 1994. It was founded at the Massachusetts Institute of Technology (MIT) Laboratory for Computer Science with support from the European Commission , and the Defense Advanced Research Projects Agency , which had pioneered the ARPANET ,

2160-706: The XQuery were developed by the W3C: Both reached Recommendation status as extensions to XQuery 1.0, but work on taking them forward to work with XQuery 3.0 was abandoned for lack of resources. Work on XQuery 3.0 was published as a Recommendation on 8 April 2014, and XQuery 3.1 is a Recommendation as at February 2017. A scripting (procedural) extension for XQuery was designed, but never completed. The EXPath Community Group develops extensions to XQuery and other related standards ( XPath , XSLT , XProc , and XForms ). The following extensions are currently available: JSONiq

2214-566: The database world. Ultimately, collections of XML files will be accessed like databases." XQuery is a functional, side effect-free , expression-oriented programming language with a simple type system , summed up by Kilpeläinen: All XQuery expressions operate on sequences, and evaluate to sequences. Sequences are ordered lists of items. Items can be either nodes , which represent components of XML documents, or atomic values , which are instances of XML Schema base types like xs:integer or xs:string . Sequences can also be empty, or consist of

XQuery - Misplaced Pages Continue

2268-736: The dynamic matching of template rules, and the ability to override rules using xsl:import , that make it possible to write applications with multiple customization layers. The absence of these facilities from XQuery 1.0 was a deliberate design decision: it has the consequence that XQuery is very amenable to static analysis, which is essential to achieve the level of optimization needed in database query languages. This also makes it easier to detect errors in XQuery code at compile time. The fact that XSLT 2.0 uses XML syntax makes it rather verbose in comparison to XQuery 1.0. However, many large applications take advantage of this capability by using XSLT to read, write, or modify stylesheets dynamically as part of

2322-455: The first integer in the title (e.g. CSS3 = Level 3). Subsequent revisions on each level are denoted by an integer following a decimal point (for example, CSS2.1 = Revision 1). The W3C standard formation process is defined within the W3C process document, outlining four maturity levels through which each new standard or recommendation must progress. After enough content has been gathered from 'editor drafts' and discussion, it may be published as

2376-455: The first integer in the title (e.g. CSS3 = Level 3). Subsequent revisions on each level are denoted by an integer following a decimal point (for example, CSS2.1 = Revision 1). The W3C standard formation process is defined within the W3C process document, outlining four maturity levels through which each new standard or recommendation must progress. After enough content has been gathered from 'editor drafts' and discussion, it may be published as

2430-715: The full list of types is based on the primitive types defined in XML Schema . Features for updating XML documents or databases, and full text search capability, are not part of the core language, but are defined in add-on extension standards: XQuery Update Facility 1.0 supports update feature and XQuery and XPath Full Text 1.0 supports full text search in XML documents. XQuery 3.0 adds support for full functional programming, in that functions are values that can be manipulated (stored in variables, passed to higher-order functions, and dynamically called). The sample XQuery code below lists

2484-413: The means to extract and manipulate data from XML documents or any data source that can be viewed as XML, such as relational databases or office documents. XQuery contains a superset of XPath expression syntax to address specific parts of an XML document. It supplements this with a SQL -like " FLWOR expression" for performing joins. A FLWOR expression is constructed from the five clauses after which it

2538-729: The most direct predecessor to the modern Internet . It was located in Technology Square until 2004, when it moved, with the MIT Computer Science and Artificial Intelligence Laboratory, to the Stata Center. The organization tries to foster compatibility and agreement among industry members in the adoption of new standards defined by the W3C. Incompatible versions of HTML are offered by different vendors, causing inconsistency in how web pages are displayed. The consortium tries to get all those vendors to implement

2592-622: The standard matures. A candidate recommendation is a version of a more mature standard than the WD. At this point, the group responsible for the standard is satisfied that the standard meets its goal. The purpose of the CR is to elicit aid from the development community on how implementable the standard is. The standard document may change further, but significant features are mostly decided at this point. The design of those features can still change due to feedback from implementors. A proposed recommendation

2646-526: The standard matures. A candidate recommendation is a version of a more mature standard than the WD. At this point, the group responsible for the standard is satisfied that the standard meets its goal. The purpose of the CR is to elicit aid from the development community on how implementable the standard is. The standard document may change further, but significant features are mostly decided at this point. The design of those features can still change due to feedback from implementors. A proposed recommendation

2700-439: The unique speakers in each act of Shakespeare's play Hamlet, encoded in hamlet.xml All XQuery constructs for performing computations are expressions . There are no statements , even though some of the keywords appear to suggest statement-like behaviors. To execute a function, the expression within the body is evaluated and its value is returned. Thus to write a function to double an input value, one simply writes: To write

2754-466: The update facilities in the language that are under development. XQuery 1.0 lacked any kind of mechanism for dynamic binding or polymorphism; this has been remedied with the introduction of functions as first-class values in XQuery 3.0. The absence of this capability starts to become noticeable when writing large applications, or when writing code that is designed to be reusable in different environments. XSLT offers two complementary mechanisms in this area:

SECTION 50

#1732775259272

2808-421: Was founded in 1994 by Tim Berners-Lee after he left the European Organization for Nuclear Research ( CERN ) in October 1994. It was founded at the Massachusetts Institute of Technology (MIT) Laboratory for Computer Science with support from the European Commission , and the Defense Advanced Research Projects Agency , which had pioneered the ARPANET , the most direct predecessor to the modern Internet . It

2862-471: Was located in Technology Square until 2004, when it moved, with the MIT Computer Science and Artificial Intelligence Laboratory, to the Stata Center. The organization tries to foster compatibility and agreement among industry members in the adoption of new standards defined by the W3C. Incompatible versions of HTML are offered by different vendors, causing inconsistency in how web pages are displayed. The consortium tries to get all those vendors to implement

2916-406: Was primarily conceived as a database query language in the tradition of SQL . Because the two languages originate in different communities, XSLT is stronger in its handling of narrative documents with more flexible structure, while XQuery is stronger in its data handling (for example, when performing relational joins). XSLT 1.0 appeared as a Recommendation in 1999, whereas XQuery 1.0 only became

#271728