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

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

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


Subject: Re: <div> in <include>



> <div> elements are equally sensible for the <include> element.
>
> <grammar>
>     <include href="...">
>         <div>
>             <define name="foo">
>                 ...
>             </define>
>         </div>
>
>         <define name="joe">
>             ...
>         </define>
>     </include>
>
>     ....
> </grammar>
>
>
> <div>s inside a <grammar> element and <div>s inside a <include> element
> is not equal, for example because the former is allowed to have a <start>
> element where the latter isn't.

You need to be able to have a <start> inside an <include>, so it makes sense
to have a <start> inside a <div> inside a <include>.

However, I don't think we want <include>s to nest.  So this means that a
<div> inside an <include> is like a <div> outside an <include> except that
it can't contain an <include>.   I don't think this requires us to have two
names for <div>.  It's just like an exclusion in XML.  RELAX NG allows
context-sensitive content models, and this seems to me an appropriate use of
them.

This is what I would propose for the content model of <grammar>:

  <define name="pattern" combine="choice">
    <element name="grammar">
      <ref name="common-atts"/>
      <ref name="grammar-content"/>
    </element>
  </define>

  <define name="grammar-content">
    <interleave>
      <ref name="other"/>
      <zeroOrMore>
        <choice>
          <ref name="start-element"/>
          <ref name="define-element"/>
          <element name="div">
            <ref name="common-atts"/>
            <ref name="grammar-content"/>
          </element>
          <element name="include">
            <attribute name="href">
              <data type="anyURI"/>
            </attribute>
            <ref name="common-atts"/>
            <ref name="include-content"/>
          </element>
        </choice>
      </zeroOrMore>
    </interleave>
  </define>

  <define name="include-content">
    <interleave>
      <ref name="other"/>
      <zeroOrMore>
        <choice>
          <ref name="start-element"/>
          <ref name="define-element"/>
          <element name="div">
            <ref name="common-atts"/>
            <ref name="include-content"/>
          </element>
        </choice>
      </zeroOrMore>
    </interleave>
  </define>

James





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


Powered by eList eXpress LLC