[ http://issues.apache.org/jira/browse/XERCESJ-1112?page=comments#action_12358520 ]
Sandy Gao commented on XERCESJ-1112: ------------------------------------ Just took another look at your schemas. Basically what you have is: descriptSchema.xsd (Call it R for root) redefines both complexElements.xsd (call it R1 for redefine #1) and complexElements.xsd (call it R2), and R1 and R2 some how include each other. Assume C1 (component #1) in R1 and C2 in R2 are redefined. This is (argurably) invalid. The schema corresponding to R1 has both C1 and C2; C1 is redefined in R so now you have C1_new, C1_old, and C2. The schema corresponding to R2 also has both C1 and C2; C2 is redefined in R so now you have C1, C2_new, and C2_old. The processor is supposed to put all these 6 components into the schema corresponding to R, and a "duplicate component" error is resulted, because C1_new (from R+R1) and C1 (from R2) are same-named but different global components. The same for C2_new and C2. I agree that Xerces isn't helping in diagnose the problem because it reports "duplicate component" error for almost all components, as opposed to just C1 and C2. To report a more meaningful error is very difficult given the current architecture, and I'd very much like not to do it. Note that I had originally thought that you only had 1 redefine in descriptSchema.xsd. Xerces couldn't handle that case either, which is fixable bug. I've put together a fix for that and am in the middle of reviewing it. Unfortunately, the schema spec doesn't allow you to do what you really want to do: to redefine components in Both XSD1 and XSD2 where XSD1 includes XSD2. I've raised a similar issue here [1]. [1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=2330 > The parser do no support multiple inclusions of the same "sub"-schema > --------------------------------------------------------------------- > > Key: XERCESJ-1112 > URL: http://issues.apache.org/jira/browse/XERCESJ-1112 > Project: Xerces2-J > Type: Bug > Components: XML Schema Structures > Versions: 2.7.1 > Environment: Any platform. Problem exists on any version of Xerces > Reporter: Jean-Jacques Thomasson > Assignee: Sandy Gao > Attachments: dm.zip > > An example : > In a schema named "complexTypes.xsd", we define the following inclusions : > <xs:include schemaLocation="attributeGroups.xsd"/> > <xs:include schemaLocation="simpleElements.xsd"/> > <xs:include schemaLocation="complexElements.xsd"/> > <xs:include schemaLocation="elementGroups.xsd"/> > and, in "complexEelements.xsd", we use the following inclusions : > <xs:include schemaLocation="complexTypes.xsd"/> > (Since we need element definitions to define complexTypes and vice-versa). > Most of the parsers (XSV, XMLSpy) are now supporting this kind of > self-mirroring inclusions which is admitted by the W3C recommendation (Note > 2 of section 4.2.1 "Schema Representation Constraint: Inclusion Constraints > and Semantics "). > But Xerces produces (a series of) the following sample message : > "[Error] complexTypes.xsd:32:54: sch-props-correct.2: A schema cannot contain > two global components with the same name; this schema contains two > occurrences of ',contentType_fn3dktizrknc9pi'." > It is an important matter of concern for industries wishinig to have a > complex architecture of schemas such as the aeerospace industry. > Please, could you look at this ? > Jean-Jacques Thomasson > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - 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]
