Share via


Using XPath

This is preliminary documentation and subject to change.

XPath is an XML query language, which is used to refer to elements in a document that satisfy certain conditions. HD DVD supports a subset of XPath with some new commands.

Note    The iHD support of XPath does not support axis specifiers.

To associate timing elements with specific display elements, the XPath language is used from the begin, end, and select attributes. For more information about timing elements, see Animation and Timing.

XPath is also used in script with the evaluateXPath function.

The following example sets all buttons to have a red background:

<cue select="//button" begin="0s" dur="1s">
    <set style:backgroundColor="red" />
</cue>

The following example sets only the button with the pointer over it to have a red background:

<cue begin="//button[state:pointer()=true()]" dur="30f">
    <set style:backgroundColor="red" />
</cue>

If you want to select a specific button by using its ID attribute, use the id function as follows:

<cue select="id('button')" begin="40s" dur="30s">
    <set style:backgroundColor="red" />
</cue>

Similarly, you can refer to the set of elements that share a class identifier by using the class function:

<cue select="class('buttonGroupA')" begin="20s" dur="10s">
    <set style:backgroundColor="red" />
</cue>

XPath is a sophisticated language, and explaining it further is beyond the scope of this guide. For more information on what subset of XPath is supported by HD DVD, and what features are added, consult the HD DVD specification.

See Also