ZVON > Tutorials > XPointer Tutorial
>> Example 2 / 3 << | Prev | Next |
Contents > element() scheme > Matching elements by ID

Matching elements by ID

The element BBB has an id attribute which is of the ID-type (defined by DTD).

XPointer:element(b1)
Corresponding XPath:id('b1')
Matches element with ID "b1".

<!DOCTYPE   AAA
[
<!ELEMENT   AAA   (BBB+)>
<!ELEMENT   BBB   EMPTY>
<!ATTLIST   BBB
                              id   ID   #REQUIRED>
]
>

<AAA>
   <BBB   id="b1"/>
   <BBB   id="b2"/>
</AAA>