Chapter-9 XML Query Languages: Xquery and Xpath
Chapter-9 XML Query Languages: Xquery and Xpath
XML BRINGS WITH IT some powerful query languages for dealing with the hierarchical format that is typical of an XML document. This chapter covers XQuery integration as well as the differences between native query language hosting and SQLXML support in SQL Server 2000.
What Is XQuery?
In the preceding chapter, we covered the XML native data type in SQL Server 2005. The XML data type is typically a complex type- that is, a type that almost always contains more than one value. We can use XML data type columns in two distinct ways. Query the data and perform actions on it as though it were a simple data type. This is analogous to the way we would treat an XML file in the file system; we read the entire file or write the entire file. Run queries and actions on the XML data in the column. Using the fact that the XML Infoset model allows the concrete data to be exposed as a sequence of data value or nodes. For this we need an XML query language. Currently, the most used query language in XML is XPath. XPath 1.0 is a mature W3C recommendation. XPath uses a syntax for queries that is