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: [relax-ng] Re: DOM Abstract Schemas revisited


Kohsuke KAWAGUCHI scripsit:

> -  ASModel has a map from name(string) to ASElementDecl. This doesn't
>    match RELAX NG's semantics where we don't have globally identifiable
>    name for element declarations.

However, the objectName is not constrained by AS except that it must be
unique among ASElementDecls.  Therefore, a RNG-based AS implementation
could assign any string it pleased.

>    ASModel doesn't allow the schema to express the constraint about the
>    top level. So the only way for applications to get a reference to
>    ASElementDecl is through ASModel.elementDecls. If you set them all to
>    empty, how can the application access schema information?

I don't understand what you mean by "empty" here.
But since there can be more than one elementDecl object in the
elementDecls map with a given universal name, AS validation has
to treat them as an implicit choice.

> -  RELAX NG has a pattern, which is globally identifiable. How can we
>    represent this concept in ASModel?

We can't directly.  Patterns become either ASContentModels or
ASElementDecls or ASAttributeDecls or whatever they need to be,
and can be factored appropriately.

The issue is not whether AS maps RNG concepts directly,
but whether RNGs can be transformed into ASModels without loss of
expressiveness.  I think they can be, except for the points I mentioned
previously, of which wildcard naming is the most important.

> -  How do we represent attribute&element mixed content model in AS? For
>    example, how do you represent
>    
>    <element name="foo">
>      <choice>
>        <attribute name="address" />
>        <element name="address"><text/></element>
>      </choice>

As a choice between distinct ElementDecls, one which is EMPTY and
allows the "name" attribute, the other which is MIXED and strict and
allows a "name" child element and no attributes.

> - The ASElementDecl.contentType property doesn't make sense at all for
>   RELAX NG. If an element is declared as:
>   
>   <element name="foo">
>     <choice>
>       <data type="integer"/>
>       <element name="child"><empty/></element>
>     </choice>
>   </element>
>   
>   Then what value should the contentType property should have?

Again, this should be split into a choice of two ASElementDecls.
In general, for each choice within an element that involves
an incompatible combination of attributes and/or content model,
multiple ASElementDecls can be generated, joined by a choice.
If they are at the top level, of course, no choice is required.

> There are just top four items from my endless list of incompatibility...

Let's have some more; it may be that I'm overlooking something fundamental.

-- 
John Cowan           http://www.ccil.org/~cowan              cowan@ccil.org
To say that Bilbo's breath was taken away is no description at all.  There
are no words left to express his staggerment, since Men changed the language
that they learned of elves in the days when all the world was wonderful.
        --_The Hobbit_


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


Powered by eList eXpress LLC