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: General concern about inter-grammar references


The way to think of the current <grammar>/<ref> mechanism is like block 
scoping in many programming languages (eg letrec in Scheme). With 
block-scoping you can refer to variables only in the current block or 
ancestor blocks. There are a couple of differences between this and RELAX 
NG. In programming language it is typically implicit which block is being 
accessed: if there's no binding in the current block, it looks in the 
parent block and so on. I don't think this would work well in the context 
of a schema, so instead it is made explicit with parentRef.  The other 
difference is that with RELAX NG you can only access the immediate parent 
rather than an arbitrary ancestor. It would be easy to fix this if 
necessary: instead of

  <parentRef name="foo"/>

do

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

Then if you really need to get to the grandparent, you can do:

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

Thus I don't think there is anything weird or strange about the kinds of 
inter-grammar access that we currently have.

James




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


Powered by eList eXpress LLC