XML DATA AND DOCUMENT STORAGE constraints and declarative integrity

XML DATA AND DOCUMENT STORAGE constraints and declarative integrity constraints to ensure that an XML document is correct. A nonvalidated XML schema still must conform to XML well-formedness rules, and a single XML document adheres to a set of rules known as the XML Information Set (Infoset), consisting of structure and some content information. Validating an XML document against schemas produces what is called a Post-Schema-Validation InfoSet (PSVI). The PSVI information makes it possible to determine a strong, well-defined type for each XML element and attribute. SQL Server 2005 introduces an XML data type. This data type can be used in table definitions to type a column, as a variable type in Transact- SQL procedural code, and as procedure parameters. A definition of a simple table containing an XML type would look like a normal CREATE TABLEstatement. CREATE TABLE xml_tab( id INT primary key, xml_col XML) In addition, columns, variables, and parameters of the XML data type can be constrained by an XML schema. XML schemas are defined in the SQL Server catalog. XML, like relational databases, has its own query language optimized for the data format. Since XML data is hierarchical, it s reminiscent of a hierarchical file system. The archetypical query language for XML documents is known as XPath. Queries in XPath reflect the hierarchical nature of XML, since nodesets are selected by using syntax similar to that used to specify files in the UNIX file system. As an example, when a typical XML document is queried using a hierarchical XPath query, the result is a node- set containing all the nodes at that level of hierarchy. Listing 1-9 shows an example of an XPath query that, when run against the purchase order document in Listing 1-8, produces a nodeset result containing all the item elements. Think of an XPath query as analogous to a SQL query. Listing 1-9: Simple XPath Query < ! this query > //pre:Item < ! produces this nodeset > < ! two Item nodes >

Dons Boxers

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services

Bookmark the permalink.

Comments are closed.