Examples

Example A.1. A List of Trees using tmh:treelist

The following example shows the use of tmh:treelist to list the trees in a topic map (in this case, two trees). This is the format of the returned document from the GetHierarchyRoots method of the Topic Map Web Service.

<tmh:treelist>
  <tmh:tree topicid="302728" displayname="Tree 1">
    <tmh:root displayname="My Root Node" tref="302740"/>
  </tmh:tree>
  <tmh:tree topicid="316060" displayname="Tree 2">
    <tmh:root displayname="Root" tref="316071" />
  </tmh:tree>
</tmh:treelist>

Example A.2. A Simple Tree Using tmh:nodelist

The following example shows the use of tmh:nodelist to describe a tree. This is the format of the returned document from the GetHierarchy method of the Topic Map Web Service.

<tmh:nodelist>
  <tmh:node>
    <tmh:topic displayname="Root" tref="316071"/>
    <tmh:children>
      <tmh:node>
        <tmh:topic displayname="Child1" tref="316075"/>
        <tmh:children>
          <tmh:node>
            <tmh:topic displayname="Child1.Child1" tref="316077"/>
            <tmh:children/>
          </tmh:node>
          <tmh:node>
            <tmh:topic displayname="Child1.Child2" tref="316079"/>
            <tmh:children/>
          </tmh:node>
        </tmh:children>
      </tmh:node>
      <tmh:node>
        <tmh:topic displayname="Child2" tref="316081"/>
        <tmh:children/>
      </tmh:node>
    </tmh:children>
  </tmh:node>
</tmh:nodelist>