<tree>

<tree> (tree) 標記一個樹狀結構,包含根節點、內部節點、葉節點、以及從根到葉的連線。 [20.2 Trees]
組件 nets — Graphs, Networks, and Trees
屬性
arity⚓︎ 根節點所擁有的子節點數以及樹狀結構的內部節點數的最大值。
狀態 非必備的
資料類型 teidata.count
ord⚓︎ (ordered) 說明樹狀結構是否整齊排列,或是部分整齊排列。
狀態 必備的
資料類型 teidata.enumerated
合法的值是:
true
樹狀結構的所有分支節點皆整齊排列。<a href="https://translate.tei-c.org/translate.html?edit=tree.xml"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" aria-label="Translation out of date." viewBox="0 0 16 16" style="position:absolute; top:2px; right:2px; color:red"><title>Translation out of date.</title> <path d="M6.146 7.146a.5.5 0 0 1 .708 0L8 8.293l1.146-1.147a.5.5 0 1 1 .708.708L8.707 9l1.147 1.146a.5.5 0 0 1-.708.708L8 9.707l-1.146 1.147a.5.5 0 0 1-.708-.708L7.293 9 6.146 7.854a.5.5 0 0 1 0-.708z"></path> <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"></path></svg></a>
partial
有些分支節點整齊排列,有些則否。
false
樹狀結構的所有分支節點皆未整齊排列。
order⚓︎ 提供樹狀結構的次序,例如節點數目。
狀態 非必備的
資料類型 teidata.count
俱乐部会员
可包含在於
可包含
core: label

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.

例子
<tree n="ex2arity="2ord="partial"
 order="13">

 <root xml:id="G-div1"
  children="#G-plu1 #G-exp1ord="true">

  <label>/</label>
 </root>
 <iNode xml:id="G-plu1"
  children="#G-exp2 #G-exp3parent="#G-div1ord="false">

  <label>+</label>
 </iNode>
 <iNode xml:id="G-exp1"
  children="#G-plu2 #G-num2.3parent="#G-div1ord="true">

  <label>**</label>
 </iNode>
 <iNode xml:id="G-exp2"
  children="#G-vara1 #G-num2.1parent="#G-plu1ord="true">

  <label>**</label>
 </iNode>
 <iNode xml:id="G-exp3"
  children="#G-varb1 #G-num2.2parent="#G-plu1ord="true">

  <label>**</label>
 </iNode>
 <iNode xml:id="G-plu2"
  children="#G-vara2 #G-varb2parent="#G-exp1ord="false">

  <label>+</label>
 </iNode>
 <leaf xml:id="G-vara1parent="#G-exp2">
  <label>a</label>
 </leaf>
 <leaf xml:id="G-num2.1parent="#G-exp2">
  <label>2</label>
 </leaf>
 <leaf xml:id="G-varb1parent="#G-exp3">
  <label>b</label>
 </leaf>
 <leaf xml:id="G-num2.2parent="#G-exp3">
  <label>2</label>
 </leaf>
 <leaf xml:id="G-vara2parent="#G-plu2">
  <label>a</label>
 </leaf>
 <leaf xml:id="G-varb2parent="#G-plu2">
  <label>b</label>
 </leaf>
 <leaf xml:id="G-num2.3parent="#G-exp1">
  <label>2</label>
 </leaf>
</tree>
Content model
<content>
 <sequence>
  <elementRef key="labelminOccurs="0"/>
  <sequence>
   <alternate minOccurs="0"
    maxOccurs="unbounded">

    <elementRef key="leaf"/>
    <elementRef key="iNode"/>
   </alternate>
   <elementRef key="root"/>
   <alternate minOccurs="0"
    maxOccurs="unbounded">

    <elementRef key="leaf"/>
    <elementRef key="iNode"/>
   </alternate>
  </sequence>
 </sequence>
</content>
宣告
<rng:element name="tree">
 <rng:ref name="att.global.attributes"/>
 <rng:ref name="att.global.analytic.attributes"/>
 <rng:ref name="att.global.change.attributes"/>
 <rng:ref name="att.global.facs.attributes"/>
 <rng:ref name="att.global.linking.attributes"/>
 <rng:ref name="att.global.rendition.attributes"/>
 <rng:ref name="att.global.responsibility.attributes"/>
 <rng:ref name="att.global.source.attributes"/>
 <rng:optional>
  <rng:attribute name="arity">
   <rng:ref name="teidata.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:attribute name="ord">
  <rng:choice>
   <rng:value>true</rng:value>
   <rng:value>partial</rng:value>
   <rng:value>false</rng:value>
  </rng:choice>
 </rng:attribute>
 <rng:optional>
  <rng:attribute name="order">
   <rng:ref name="teidata.count"/>
  </rng:attribute>
 </rng:optional>
 <rng:group>
  <rng:optional>
   <rng:ref name="label"/>
  </rng:optional>
  <rng:group>
   <rng:zeroOrMore>
    <rng:choice>
     <rng:ref name="leaf"/>
     <rng:ref name="iNode"/>
    </rng:choice>
   </rng:zeroOrMore>
   <rng:ref name="root"/>
   <rng:zeroOrMore>
    <rng:choice>
     <rng:ref name="leaf"/>
     <rng:ref name="iNode"/>
    </rng:choice>
   </rng:zeroOrMore>
  </rng:group>
 </rng:group>
</rng:element>
element tree
{
   att.global.attributes,
   att.global.analytic.attributes,
   att.global.change.attributes,
   att.global.facs.attributes,
   att.global.linking.attributes,
   att.global.rendition.attributes,
   att.global.responsibility.attributes,
   att.global.source.attributes,
   attribute arity { teidata.count }?,
   attribute ord { "true" | "partial" | "false" },
   attribute order { teidata.count }?,
   ( label?, ( ( leaf | iNode )*, root, ( leaf | iNode )* ) )
}