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: TREX TC minutes from 2001-04-19


Murata Makoto wrote:

> The first approach is very weak.  The second one is complicated.  In particular,
> it is to difficult to ensure consistencies of key declarations.  The third 
> approach appears to be powerful, and is described in "A Unified Constraint Model 
> for XML (WWW 10)" (http://www.cis.temple.edu/~fan/papers/xml/ucm.ps.gz)

I should have pointed out that the third approach relies on type assignment.  
This is powerful, but it only works when type assignment is unique.  In general, 
type assignement in TREX and RELAX is NOT unique.  Furthermore, even when there 
exists a unique assignment, it is not always easy to assign types to elements.
For example, consider this pattern.

<grammar xmlns="http://www.thaiopensource.com/trex" 
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">

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

<define name="doc">
<element name="doc">
  <optional>
    <ref name="p1"/>
  </optional>
  <zeroOrMore>
    <ref name="p2"/>
    <ref name="p1"/>
  </zeroOrMore>
</element>
</define>

<define name="p1">
  <element name="p">
    <anyString/>
  </element>
</define>

<define name="p2">
  <element name="p">
    <anyString/>
  </element>
</define>
 
</grammar>

If the number of <p>s is odd, the first <p> is of the type "p1".  Otherwise, 
the first <p> is of the type "p2".  Only after you see the very last <p> element, 
you can uniquely determine the type for the first <p> element.

Cheers,

Makoto


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


Powered by eList eXpress LLC