[ https://issues.apache.org/jira/browse/XERCESJ-1584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mukul Gandhi updated XERCESJ-1584: ---------------------------------- Fix Version/s: 2.12.0 > 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 > Assignee: Mukul Gandhi > Fix For: 2.12.0 > > 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 was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: j-dev-h...@xerces.apache.org