単純化の第14段階は、<optional> 要素の変換です。
- 対象ノードの箇所では接頭辞 "rng" は「RELAX NG 名前空間」に関連づけられているとします。
- サンプルでは見やすさのために空白や改行を入れているところがありますが、実際には単純化の第2段階で除去されています。
<mixed> 要素の変換
- 対象ノード
- //rng:optional
- 操作
- 子要素を <empty> 要素との choice に変換する。
サンプル
<optional> <attribute><name ns="">an-attribute</name><text/></attribute> </optional>
<choice> <attribute><name ns="">an-attribute</name><text/></attribute> <empty/> </choice>
事後条件
- <optional> 要素がない。