You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2014/09/17 19:10:36 UTC

[jira] [Resolved] (XMLSCHEMA-29) An element without "ref" and "type" attributes has not got any assigned XSD type but should has got "anyType" XSD type.

     [ https://issues.apache.org/jira/browse/XMLSCHEMA-29?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved XMLSCHEMA-29.
----------------------------------
    Resolution: Not a Problem
      Assignee: Daniel Kulp


Working as designed.   When serializing the schema, we need to know whether the element was specifically created without a type attribute or not so that we know whether to output a type="anyType" or omit the type attribute altogether.

> 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
>            Assignee: Daniel Kulp
>              Labels: anyType
>         Attachments: testproj.zip
>
>
> 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 corresponding to *dummyElem* element XmlSchemaElement object 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 was sent by Atlassian JIRA
(v6.3.4#6332)

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