Alexandr Klimov created XMLSCHEMA-29:
----------------------------------------

             Summary: An element without "ref" and "type" attributes has not 
got any assigned XSD type but should has got "anyType" XSD type.
                 Key: XMLSCHEMA-29
                 URL: https://issues.apache.org/jira/browse/XMLSCHEMA-29
             Project: XmlSchema
          Issue Type: Bug
    Affects Versions: 2.0.2
            Reporter: Alexandr Klimov


I faced with some trouble when I have tried parse following XSD:
{code:xml}
<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
           targetNamespace="http://www.w3schools.com";
           xmlns="http://www.w3schools.com";>

    <xs:complexType name="TestType">
        <xs:sequence>
            <xs:element name="stringElem" type="xs:string"/>
            <xs:element name="dummyElem"/>
        </xs:sequence>
    </xs:complexType>

</xs:schema>
{code}

A XmlSchemaElement object corresponds to *dummyElem* element has got 
*schemaType* and *schemaTypeName* fields equal *NULL*.

But I'm convinced that in this case 
{noformat}{http://www.w3.org/2001/XMLSchema}anyType{noformat} type should be 
assigned as type of the untyped element. My point of view based on following 
document: [W3C XML Schema Definition Language 1.1 | 
http://www.w3.org/TR/xmlschema11-1/], point 3.3.2.1

This *anyType* type is defined in 
*org.apache.ws.commons.schema.constants.Constants* class but I have not found 
where it is used in any assignment during XSD parsing.

In my opinion, 
*org.apache.ws.commons.schema.SchemaBuilder#handleElementGlobalType* method 
should contains the third condition branch for a case when *type* and *ref* 
attributes are absent and *anyType* type should be set in the branch.

May be I misunderstand something in a XSD definition and *anyType* type can not 
be assigned in this case?  

Best regards
Alexandr Klimov.   

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to