Path

The Path element in the view query definition file appends a new path segment to the current path fragment of the containing element.

The behavior of a Path element in a query is identical to that of a Relationship element, except that it does not initiate a new predicate in the XPath.

The Path element must be contained in a Relationship element or another Path element.

The Path element has the following attributes.
Attribute Description
name The name of the path to append.

The name attribute is optional. If you do not supply a name attribute, an empty path fragment is appended to the query.

Note that if you want to append a relationship to the current path fragment, you supply only the relationship name as the value of the name attribute; the parent object type is used to determine whether or not the relationship is a containment relationship, and the corresponding XPath syntax is constructed automatically (see Example 3).

treat-as Defines the specific type to be applied to the given path where the implicit type of the path is ambiguous.
The Path element can contain the following elements, which must be specified in the order shown:
Element Maximum number of occurrences
Target 1
Path 1

Example 1

This query returns all WSDL Service objects that have a Port with a name of “mainPort”
Raw XPath:
/WSRR/WSDLService[ports[@name=’mainPort’]]
Query definition:
<Query>
  <ObjectType>WSDLService</ObjectType>
  <Relationship name=”ports”>
    <Target>
      <Property name=”name” value=”mainPort”/>
    </Target>
  </Relationship>
</Query>

Example 2

This query returns all WSDL Port objects that have a name of “mainPort”
Raw XPath:
/WSRR/WSDLService/ports[@name=’mainPort’]
Query definition:
<Query>
  <ObjectType>WSDLService</ObjectType>
  <Path name=”ports”>
    <Target>
      <Property name=”name” value=”mainPort”/>
    </Target>
  </Path>
</Query>

Example 3

This query returns the binding of the port with the name of "mainPort".
Raw XPath:
/WSRR/WSDLService/ports[@name=’mainPort’]/binding(.)
Query definition:
<Query>
  <ObjectType>WSDLService</ObjectType>
  <Path name=”ports”>
    <Target>
      <Property name=”name” value=”mainPort”/>
      <Path name=”binding”/>
    </Target>
  </Path>
</Query>