--- title: "Sample Annotated XSD Schema for XPath Examples (SQLXML 4.0) | Microsoft Docs" ms.custom: "" ms.date: "03/16/2017" ms.prod: "sql-server-2016" ms.reviewer: "" ms.suite: "" ms.technology: - "dbe-xml" ms.tgt_pltfrm: "" ms.topic: "reference" helpviewer_keywords: - "XPath queries [SQLXML], annotated XSD schemas in queries" - "annotated XSD schemas, samples" - "annotated XSD schemas, queries" ms.assetid: fefa2cc8-2d3c-4336-aeae-ce063a3a8df2 caps.latest.revision: 16 author: "douglaslMS" ms.author: "douglasl" manager: "jhubbard" --- # Sample Annotated XSD Schema for XPath Examples (SQLXML 4.0) The sample XPath queries in this section refer to a mapping schema. The mapping schema is an annotated XML Schema (XSD) file. For more information about mapping schemas, see [Introduction to Annotated XSD Schemas (SQLXML 4.0)](../../../relational-databases/sqlxml/annotated-xsd-schemas/introduction-to-annotated-xsd-schemas-sqlxml-4-0.md). The following are needed to execute XPath queries against an annotated XSD schema: - Create a template with an XPath query in it. In the template, you specify the mapping schema against which the XPath query is to be executed. In this case, the mapping schema must be stored in the directory (or one of its subdirectories, in which case a relative path is specified as the value of the **mapping-schema** attribute in the template) associated with template file. - Create a test application that uses SQLXML extensions for ADO to execute queries. For more information, see [Using ADO to Execute SQLXML 4.0 Queries](../../../relational-databases/sqlxml/using-ado-to-execute-sqlxml-4-0-queries.md). In all the examples in this section, for illustration purposes, the XPath queries are specified in a template and the template is executed using ADO. Therefore, you must use the following mapping schema file, SampleSchema1.xml. Save this file in the directory where your templates are stored. ## Sample Annotated XSD Schema (SampleSchema1.xml) ``` ```