Re: [relax-ng] re: Unreachable elements

From
James Clark <>
Date
2001-10-11T05:57:33+00:00
ID
006101c15219$41a97850$
Thread
Re: [relax-ng] re: Unreachable elements
> What do you mean by unreachable?

It means that you cannot reach it if you start from the <start> element and
follow all the refs, and the refs from those refs and so on.  For example,
in

<grammar>

<start>
  <ref name="foo"/>
</start>

<define name="foo">
  <element name="foo">
    <ref name="bar"/>
  </element>
</define>

<define name="bar">
  <text/>
</define>

<define name="baz">
  <element name="baz">
    <optional>
       <ref name="baz"/>
    </optional>
  </element>
</define>

</grammar>

foo and bar are reachable but baz is not. If a definition is not reachable
then you can remove it without changing the meaning of the grammar.

James