Text Encoding Initiative

The XML Version of the TEI Guidelines

<tree>


<tree> encodes a tree, which is made up of a root, internal nodes, leaves, and arcs from root to leaves.
Attributes (In addition to global attributes and those inherited from chunk)
label gives a label for a tree.
Datatype: CDATA
Values: A character string.
Default: #IMPLIED
arity gives the maximum number of children of the root and internal nodes of the tree.
Datatype: CDATA
Values: A nonnegative integer.
Default: #IMPLIED
ord indicates whether or not the tree is ordered, or if it is partially ordered.
Datatype: (Y | N | partial)
Legal values are:
Y indicates that all of the branching nodes of the tree are ordered.
partial indicates that some of the branching nodes of the tree are ordered and some are unordered.
N indicates that all of the branching nodes of the tree are unordered.
Default: Y
order gives the order of the tree, i.e., the number of its nodes.
Datatype: CDATA
Values: A nonnegative integer.
Default: #IMPLIED
Note

The size of a tree is always one less than its order, hence there is no need for both a size and order attribute.

Example
<tree n="ex2" arity="2" ord="partial" order="13">
   <root id="div1" label="/" children="plu1 exp1" ord="Y"/>
   <iNode id="plu1" label="+" children="exp2 exp3" parent="div1" ord="N"/>
   <iNode id="exp1" label="**" children="plu2 num2.3" parent="div1" ord="Y"/>
   <iNode id="exp2" label="**" children="vara1 num2.1" parent="plu1" ord="Y"/>
   <iNode id="exp3" label="**" children="varb1 num2.2" parent="plu1" ord="Y"/>
   <iNode id="plu2" label="+" children="vara2 varb2" parent="exp1" ord="N"/>
   <leaf id="vara1" label="a" parent="exp2"/>
   <leaf id="num2.1" label="2" parent="exp2"/>
   <leaf id="varb1" label="b" parent="exp3"/>
   <leaf id="num2.2" label="2" parent="exp3"/>
   <leaf id="vara2" label="a" parent="plu2"/>
   <leaf id="varb2" label="b" parent="plu2"/>
   <leaf id="num2.3" label="2" parent="exp1"/>
</tree>
Module Declared in file teinet2; Additional tag set for Graph Theory: enabled by TEI.nets
Class chunk
Data Description A root, and zero or more internal nodes and leaves, but if there is an internal node, there must also be at least one leaf.
May contain iNode leaf root
May occur within add argument body castList corr div div0 div1 div2 div3 div4 div5 div6 div7 epigraph epilogue forest item metDecl note performance prologue q quote set sic stage view
Declaration
<!ELEMENT tree %om.RR; ((leaf | iNode)*, root, (leaf | iNode)*)>  
<!ATTLIST tree  
      %a.global;
      label CDATA #IMPLIED
      arity CDATA #IMPLIED
      ord (Y | N | partial) "Y"
      order CDATA #IMPLIED>
See further 21.2 Trees

Up: 35 Elements