OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: [relax-ng-comment] Re: recursive inlusion


You can alternate including "strong" and "em" elements
in separate documents by this way :
------------------------------------
abc.rng

<grammar>
  <start>
    <element name="abc">
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="strong"/>
          <ref name="em"/>
        </choice>
      </zeroOrMore>
    </element>
  </start>
  <define name="strong">
    <grammar>
      <include href="strong.rng">
        <define name="content">
          <parentRef name="em"/>
        </define>
      </include>
    </grammar>
  </define>
  <define name="em">
    <grammar>
      <include href="em.rng">
        <define name="content">
          <parentRef name="strong"/>
        </define>
      </include>
    </grammar>
  </define>
</grammar>
------------------------------------
strong.rng

<grammar>
  <define name="content">
    <notAllowed/>
  </define>
  <start>
    <element name="strong">
      <oneOrMore>
        <choice>
          <text/>
          <ref name="content"/>
        </choice>
      </oneOrMore>
    </element>
  </start>
</grammar>
------------------------------------
em.rng

<grammar>
  <define name="content">
    <notAllowed/>
  </define>
  <start>
    <element name="em">
      <oneOrMore>
        <choice>
          <text/>
          <ref name="content"/>
        </choice>
      </oneOrMore>
    </element>
  </start>
</grammar>
------------------------------------

The construct is the object of the "Nested grammars"
section of the tutorial
http://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html#IDA3PZR

Best regards,

Didier Demany
didier.demany@xmloperator.net
http://www.xmloperator.net/ : an XML editor


___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC