--- title: "Specifying a Node Test in the Location Path (SQLXML 4.0) | Microsoft Docs" ms.custom: "" ms.date: "03/06/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: xml ms.topic: "reference" helpviewer_keywords: - "XPath queries [SQLXML], location paths" - "principal node types [SQLXML]" - "node tests [SQLXML]" - "location path for XPath query" ms.assetid: f46c30bf-1e24-4435-9ac2-f8ba43a8ff94 author: MightyPen ms.author: genemi manager: craigg --- # Specifying a Node Test in the Location Path (SQLXML 4.0) A node test specifies the node type selected by the location step. Every axis (`child`, `parent`, `attribute`, or `self`) has a principal node type. For the `attribute` axis, the principal node type is **\**. For the `parent`, `child`, and `self` axes, the principal node type is **\**. > [!NOTE] > The wildcard node test * (for example, `child::*`) is not supported. ## Node Test: Example 1 The location path `child::Customer` selects **\** element children of the context node. In this example, `child` is the axis and `Customer` is the node test. The principal node type for the `child` axis is **\**. Therefore, the node test is TRUE if the **\** node is an **\** node. If the context node has no **\** children, an empty set of nodes is returned. ## Node Test: Example 2 The location path `attribute::CustomerID` selects the **CustomerID** attribute of the context node. In the example, `attribute` is the axis and `CustomerID` is the node test. The principal node type of the `attribute` axis is **\**. Therefore, the node test is TRUE if **CustomerID** is an **\** node. If the context node has no **CustomerID**, an empty set of nodes is returned. > [!NOTE] > In this implementation of XPath, if a location step refers to an **\** or an **\** type that is not declared in the schema, an error is generated. This is different from the implementation of XPath in MSXML, which returns an empty node set. ## Abbreviated Syntax for the Axes The following abbreviated syntax for the location path is supported: - `attribute::` can be abbreviated to `@`. The location path `Customer[@CustomerID="ALFKI"]` is the same as `child::Customer[attribute::CustomerID="ALFKI"]`. - `child::` can be omitted from a location step. Thus, `child` is the default axis. The location path `Customer/Order` is the same as `child::Customer/child::Order`. - `self::node()` can be abbreviated to one period (.), and `parent::node()` can be abbreviated to two periods (..).