This topic has not yet been rated - Rate this topic

Executing XPath Queries with Namespaces

SQL Server 2000

Previously, in Microsoft® SQL Server™ 2000, you could execute XPath queries with namespaces only by specifying the XPath query in a template. In Microsoft SQLXML 3.0:

  • You can specify XPath queries with namespaces against mapping schemas in the URL. In this case, the namespaces parameter must be specified in the URL in order to specify the namespace binding that will resolve the prefix. For example:
    http://localhost/nwind/schema/SampleSchema.xml/x:Employee?namespaces=xmlns:x='urn:myschema:Employees'&root=root
    

    In this URL, x:Employee is the XPath query that is executed against the mapping schema (SampleSchema.xml). The namespaces parameter provides the binding to resolve the prefix.

    For more information, see Executing XPath Queries with Namespaces in the URL.

    Note that you can specify multiple values separated by spaces for namespaces in the URL.

  • You can execute XPath queries with namespaces by using the SQLXMLOLEDB Provider. A provider-specific property, namespaces, allows you to provide binding to resolve the prefix.

    For more information, see Executing XPath Queries with Namespaces (SQLXMLOLEDB Provider).

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.