error in specifications?

Hi there,

I checked the xml specs and it says:

complexType 
  abstract = boolean : false
  block = (#all | List of (extension | restriction)) 
  final = (#all | List of (extension | restriction)) 
  id = ID 
  mixed = boolean : false
  name = NCName 
  {any attributes with non-schema namespace . . .}>
  Content: (annotation?, (simpleContent | complexContent | ((group | all |
choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?))))
</complexType>


Which means to me that the following is valid:

<xsd:complexType name="bla">
  <xsd:simpleContent>
    <xsd:restriction ....>
  </xsd:simpleContent>
  <xsd:attribute name="..."/>
</xsd:complexType>

However, XMLSpy does not think so.. 


Then I found this example:

<xs:complexType name="length1">
 <xs:simpleContent>
  <xs:extension base="xs:non-negative-integer">
   <xs:attribute name="unit" type="xs:NMTOKEN"/>
  </xs:extension>
 </xs:simpleContent>
</xs:complexType>


Is XMLSpy wrong?

Then:

I just wish to declare a tag like  <blah blah="blah">blah</blah>

This is not possible with an anonymous complexType definition. How come?

What I would like to do is:

<element name="blah" type="xsd:string">
  <complexType>
    <xsd:attribute ...>
  </complexType>
</element>

but this is not possible if element is not below the root node (haven't
tested it when it's below the root node, however..)

Any clarifications on this?

Thanks a lot!

Received on Wednesday, 28 March 2001 10:32:44 UTC