With aid of Xpath, X4Dialog assigns each XML element an ID as an attribute.

COMPONENT JAVA
X4Dialog: Help for Dynamic Web Sites
Oliver Brüning
Listing 2. With aid of Xpath, X4Dialog assigns each XML element an ID as an attribute.


<?xml version="1.0" encoding="ISO-8859-1"?>
<composition>
  <key_address>
    <root wid="key_address:root[1]">
      <address wid="key_address:root[1]/address[1]">
        <name wid="key_address:root[1]/address[1]/name[1]">Mustermann</name>
        <fname wid="key_address:root[1]/address[1]/fname[1]">Erika</fname>
        <street wid="key_address:root[1]/address[1]/street[1]">Test Street</street>
        <city wid="key_address:root[1]/address[1]/city[1]">New York</city>
        <state wid="key_address:root[1]/address[1]/state[1]">New York</state>
        <readerofjavareport wid="key_address:root[1]/address[1]/readerofjavareport[1]">
          true
        </readerofjavareport>
        <pet wid="key_address:root[1]/address[1]/pet[1]">Cat</pet>
      </address>
      <address wid="key_address:root[1]/address[2]">
        <name wid="key_address:root[1]/address[2]/name[1]">Test</name>
        <fname wid="key_address:root[1]/address[2]/fname[1]">Tina</fname>
        <street wid="key_address:root[1]/address[2]/street[1]">Cologne Drive</street>
        <city wid="key_address:root[1]/address[2]/city[1]">Austin</city>
        <state wid="key_address:root[1]/address[2]/state[1]">Texas</state>
        <readerofjavareport wid="key_address:root[1]/address[2]/readerofjavareport[1]">
          false
        </readerofjavareport>
        <pet wid="key_address:root[1]/address[2]/pet[1]">Dog</pet>
      </address>
    </root>
  </key_address>
  <key_reiter>
    <reiter wid="key_reiter:reiter[1]">
      <reiteritem wid="key_reiter:reiter[1]/reiteritem[1]">
        <label wid="key_reiter:reiter[1]/reiteritem[1]/label[1]">List</label>
        <id wid="key_reiter:reiter[1]/reiteritem[1]/id[1]">list</id>
        <command wid="key_reiter:reiter[1]/reiteritem[1]/command[1]">list</command>
      </reiteritem>
      <reiteritem wid="key_reiter:reiter[1]/reiteritem[2]">
        <label wid="key_reiter:reiter[1]/reiteritem[2]/label[1]">New Address</label>
        <id wid="key_reiter:reiter[1]/reiteritem[2]/id[1]">new</id>
        <command wid="key_reiter:reiter[1]/reiteritem[2]/command[1]">new</command>
      </reiteritem>
      <reiteritem wid="key_reiter:reiter[1]/reiteritem[3]">
        <label wid="key_reiter:reiter[1]/reiteritem[3]/label[1]">Edit</label>
        <id wid="key_reiter:reiter[1]/reiteritem[3]/id[1]">edit</id>
        <command wid="key_reiter:reiter[1]/reiteritem[3]/command[1]">edit</command>
      </reiteritem>
    </reiter>
  </key_reiter>
  <key_message>
    <root wid="key_message:root[1]">
      <message wid="key_message:root[1]/message[1]">
        this is the 1st message of the day.
      </message>
    </root>
  </key_message>
</composition>