Re: [xml] Correct behaviour of RelaxNG interleave



* Bjoern Hoehrmann wrote:
Your test case somewhat simplified:

 a = element a { empty }
 b = element b { empty }
 c = element c { empty }
 d = element d { empty }
 
 e = a & b
 f = c & d
 
 start = element root { e & f }

As Daniel asked, this would be

  <grammar xmlns="http://relaxng.org/ns/structure/1.0";>
    <define name="a">
      <element name="a">
        <empty/>
      </element>
    </define>
    <define name="b">
      <element name="b">
        <empty/>
      </element>
    </define>
    <define name="c">
      <element name="c">
        <empty/>
      </element>
    </define>
    <define name="d">
      <element name="d">
        <empty/>
      </element>
    </define>
    <define name="e">
      <interleave>
        <ref name="a"/>
        <ref name="b"/>
      </interleave>
    </define>
    <define name="f">
      <interleave>
        <ref name="c"/>
        <ref name="d"/>
      </interleave>
    </define>
    <start>
      <element name="root">
        <interleave>
          <ref name="e"/>
          <ref name="f"/>
        </interleave>
      </element>
    </start>
  </grammar>

in the XML syntax.
-- 
Björn Höhrmann · mailto:bjoern hoehrmann de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]