Re: [relax-ng] Trang XSD output

From
James Clark <>
Date
2002-08-09T08:16:39+00:00
ID
000f01c23f7c$f88a1a10$
Thread
Re: [relax-ng] Trang XSD output
> I was a little surprised that elements with <text/> content were
translated
> to have mixed content in the Trang XSD output. For example:
>
> <element name="day">
>  <text/>
> </element>
>
> becomes
>
> <xs:element name="day">
>   <xs:complexType mixed="true"/>
> </xs:element>

I believe that's correct.

> which is an implicit anyType.

Are you sure?  My understanding is that:

  <xs:complexType/>

is short for

  <xs:complexType>
    <xs:complexContent>
      <xs:restriction base="xs:anyType">
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

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).

> I suppose this is an early, alpha version approach that will fade away in
> later versions.

Only if somebody reports them.

James