<?xml version="1.0" encoding="utf-8"?>
<article xmlns="http://docbook.org/ns/docbook" version="5.0"
         xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>Article wrapper</title>
<annotation annotates="xpath:(/db:article/db:para)[1]/db:phrase"
            role="after">
<para>This is the word.</para>
</annotation>
<annotation xml:id="miss" annotates="xpath:(//db:para)[1]/db:phrase">
<para>This is a miss.</para>
</annotation>
<annotation annotates="xpath://db:para">
<para>All the paragraphs!.</para>
</annotation>
<annotation annotates="p1" role="before">
<para>This is the paragraph that contains the word.</para>
</annotation>
<annotation annotates="xpath:id('table')/db:tgroup/db:tbody/db:row[3]/db:entry[4]"
            role="after">
<para>Number 9. Number 9. Number 9…</para>
</annotation>
<annotation xml:id="a1">
<para>This annotation has the id ‘a1’.</para>
</annotation>
</info>

<para xml:id="p1">This article tests placing annotations by XPath expression.
This <phrase>word</phrase> is annotated.</para>

<table xml:id="table" rowheader="firstcol">
  <title>Multiplication table</title>
  <tgroup cols="6">
    <thead>
      <row>
        <entry></entry>
        <entry>1</entry>
        <entry>2</entry>
        <entry>3</entry>
        <entry>4</entry>
        <entry>5</entry>
      </row>
    </thead>
    <tbody>
      <row>
        <entry>1</entry>
        <entry>1</entry>
        <entry>2</entry>
        <entry>3</entry>
        <entry>4</entry>
        <entry>5</entry>
      </row>
      <row>
        <entry>2</entry>
        <entry>2</entry>
        <entry>4</entry>
        <entry>6</entry>
        <entry>8</entry>
        <entry>10</entry>
      </row>
      <row>
        <entry>3</entry>
        <entry>3</entry>
        <entry>6</entry>
        <entry>9</entry>
        <entry>12</entry>
        <entry>15</entry>
      </row>
      <row>
        <entry>4</entry>
        <entry>4</entry>
        <entry>8</entry>
        <entry>12</entry>
        <entry>16</entry>
        <entry>20</entry>
      </row>
      <row>
        <entry>5</entry>
        <entry>5</entry>
        <entry>10</entry>
        <entry>15</entry>
        <entry>20</entry>
        <entry>25</entry>
      </row>
    </tbody>
  </tgroup>
</table>

<para annotations="miss a1">Here’s a paragraph.</para>
<annotation annotates="xpath:preceding-sibling::db:para[1]"
            role="before">
<para>This annotation is placed relatively.</para>
</annotation>
</article>
