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

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

I haven't worked on this area of implementation much, so will take time to 
analyze the approach for fixes (I actually, tried to look at the codebase to 
try making this fix, but still haven't got enough clarity). Perhaps, more 
knowledgeable committers of this area of implementation may pursue this fix.

If you can provide a patch, or suggest that which areas of the implementation 
to look at to make this fix, it'll speed up the fix for this bug.
                
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to