Specify Metaproperties

Metaproperty attributes in an XML document are attributes that describe the properties of an XML item,

Metaproperty attributes in an XML document are attributes that describe the properties of an

XML item, such as element, attribute, or any other DOM node. These attributes don’t physically

exist in the XML document text. However, OPENXML provides these metaproperties for all the

XML items. These metaproperties allow you to extract information, such as local positioning

and namespace information, of XML nodes. This information provides you with more details

than are apparent in the textual representation.

You can map these metaproperties to the rowset columns in an OPENXML statement by using

the

ColPattern

parameter. The columns will contain the values of the metaproperties to which

they’re mapped. For more information about the syntax of OPENXML, see

OPENXML (Transact-

SQL).

To access the metaproperty attributes, a namespace that is specific to SQL Server is provided.

This namespace,

allows the user to access the

metaproperty attributes. If the result of an OPENXML query is returned in an edge table format,

the edge table contains one column for each metaproperty attribute, except the

metaproperty.

Some of the metaproperty attributes are used for processing purposes. For example, the

metaproperty attribute is used for overflow handling. Overflow handling refers to the

unconsumed, unprocessed data in the document. One of the columns in the rowset that is

generated by OPENXML can be identified as the overflow column. You do this by mapping it to

the

metaproperty by using the

ColPattern

parameter. The column then receives the

overflow data. The

flags

parameter determines whether the column contains everything or only

the unconsumed data.

The following table lists the metaproperty attributes that each parsed XML element possesses.

These metaproperty attributes can be accessed by using the namespace. Any value that the user sets directly in the XML document by

using these metaproperties is ignored.

Note

You cannot reference these metaproperties in any XPath navigation.

Expand table

urn:schemas-microsoft-com:xml-metaprop xmltext xmltext xmltext urn:schemas-
microsoft-com:xml-metaprop