You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (JIRA)" <xe...@xml.apache.org> on 2012/09/29 08:54:08 UTC

[jira] [Commented] (XERCESJ-1584) Warning should be issued when redefining complex type which is not directly in the redefined schema

    [ https://issues.apache.org/jira/browse/XERCESJ-1584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466134#comment-13466134 ] 

Mukul Gandhi commented on XERCESJ-1584:
---------------------------------------

I think, we should restore the behavior of this as it was with Xerces 2.9.1. It seems some bug has creeped in for this feature, due to schema 1.1 implementation we've done. By making the correction, we'll then differ with Saxon (but I stand by my analysis).
                
> Warning should be issued when redefining complex type which is not directly in the redefined schema
> ---------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1584
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1584
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.0 Datatypes
>    Affects Versions: 2.11.0
>            Reporter: Radu Coravu
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> I have 3 schemas like:
> 1.xsd:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="tns">
>     <xs:complexType name="ct"/>
> </xs:schema>
> 2.xsd:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="tns">
>     <xs:include schemaLocation="1.xsd"/>
> </xs:schema>
> 3.xsd:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="tns" xmlns="tns">
>     <xs:redefine schemaLocation="2.xsd">
>         <xs:complexType name="ct">
>             <xs:complexContent>
>                 <xs:extension base="ct">
>                     <xs:attribute name="attr" use="required"/>
>                 </xs:extension>
>             </xs:complexContent>
>         </xs:complexType>
>     </xs:redefine>
>     <xs:element name="el" type="ct"/>
> </xs:schema>
> When validating "3.xsd" Xerces reports it as valid.
> When validating "3.xsd" Saxon 9 EE reports:
> The redefined complex type was found, but not in the schema document referenced by the schemaLocation attribute of the containing <xs:redefine> element. This is not allowed by the XSD specification. However, Saxon does not currently enforce this rule.
> There are two problems:
> 1) In Xerces 2.9.0 this construct used to work, the complex type "ct" was redefined. 
> So if you had an XML instance like:
> <el xmlns="tns"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="tns file:/C:/Users/radu_coravu/Desktop/testWarning/3.xsd"/>
> Xerces 2.9.1 reported an error, that the attribute "attr" was absent.
> Xerces 2.11.0 no longer reports any error.
> 2) If you want to keep the current behavior of ignoring completely the redefine, then you should at least report a problem when validating the "3.xsd" schema like Saxon EE does.

--
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: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org