You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/08/27 17:32:16 UTC

DO NOT REPLY [Bug 12086] New: - Empty Complex Type grammar

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12086>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12086

Empty Complex Type grammar

           Summary: Empty Complex Type grammar
           Product: Xerces-C++
           Version: 2.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: PeterV@ti.com.od.ua


I got an error when proceed the following schema:
<xs:element name="main2">
  <xs:complexType>
   <xs:complexContent>
     <xs:attribute name="name" type="xs:string"/>
   </xs:complexContent>
  </xs:complexType>
 </xs:element>

Error: The content of the complexContent element is invalid. The content must 
be RESTRICTION or EXTENSION

With the updated schema everything was ok:

<xs:element name="main2">
  <xs:complexType>
   <xs:complexContent>
     <xs:restriction base="xs:anyType">
       <xs:attribute name="name" type="xs:string"/>
     </xs:restriction>
   </xs:complexContent>
  </xs:complexType>
 </xs:element>


But reading the documentation (http://www.w3.org/TR/xmlschema-0/#emptyContent), 
I found the following:
----------------------
The preceding syntax for an empty-content element is relatively verbose, and it 
is possible to declare the internationalPrice element more compactly: (see my 
first example) 

This compact syntax works because a complex type defined without any 
simpleContent or complexContent is interpreted as shorthand for complex content 
that restricts anyType. 

So the first schema should be considered valid also.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org