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: [relax-ng] Trang XSD output



> which allows neither attributes, child elements not child text nodes, and
> thus that
> 
>   <xs:complexType mixed="true"/>
> 
> allows just child text nodes and hence is equivalent to
> 
>   <text/>
> 
> in RELAX NG.  I may be wrong -- I often find I misunderstand XSD -- but both
> MSXML and XSV seem to agree with me (the version of MSV I tried doesn't
> though).

It came to me last night (all of the sudden!) that maybe your
interpretation is wrong.

If you look at the complex type schema component, the {content type}
property says it can be one of three:

1) empty
2) simple type
3) pair of content model and one of "mixed", "element-only"

Thus as you see, "mixed" is applicable only when there's a content model.
The concept of "mixed but no content model" can be still expressed by
using an empty <sequence>, but I'm not sure if the spec says

<complexType name="foo" mixed="true"/>

will be implicitly transformed into:

<complexType name="foo" mixed="true">
  <complexContent>
    <restriction base="anyType">
      <sequence/>

And if you look at how the content type is parsed from XML (3.4.2), it
says:

1 If the <restriction> alternative is chosen, then the appropriate case
among the following:
1.1 If one of the following is true
1.1.1 There is no <group>, <all>, <choice> or <sequence> among the
[children]; 
1.1.2 There is an <all> or <sequence> among the [children] with no
[children] of its own excluding <annotation>; 
1.1.3 There is a <choice> among the [children] with no [children] of its
own excluding <annotation> whose minOccurs [attribute] has the Eactual
valueE 0; 
, then empty;


So I guess if you take the spec at its face value, you'll get just "empty"
without any mixed semantics.


I'm not 100% certain but this seems like yet another gray area in the
spec.

regards,
--
Kohsuke KAWAGUCHI
Sun Microsystems                   kohsuke.kawaguchi@sun.com



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


Powered by eList eXpress LLC