OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Problems with refefinements of xmldsig-core-schema and xenc-schema

[ Lists Home | Date Index | Thread Index ]

Title: Problems with refefinements of xmldsig-core-schema and xenc-schema

Hello List,

for our needs we need to constrain the official w3c signature and encryption schemas xdsig-core-schema.xsd and xenc-schema using the xml-schema-redefine mechanismen.

Unfortunately doing this we obtain error-messages regarding of namecollisions of the complextypes defined in the original w3c-schemas and the refined schemas during the validation of the redefined schemas.

Our proceding is as follows:
1. Starting with a valid xmldsig-core-schema.xsd we construct a schema named redefined-sig.xsd listed below, which is also valid.

 Redefine xmldsig-core-schema:
        <xsd:schema targetNamespace="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <!-- ### redefinitions ### -->
  <xsd:redefine schemaLocation="file:///E:/SQC/w3c/xmldsig-core-schema.xsd"></xsd:redefine>

2. Starting with a valid xenc-schema.xsd we construct a schema named redefined-xenc.xsd listed below, which is also valid.

 Redefine xenc-schema:
        <xsd:schema targetNamespace="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="file:///E:/SQC/w3c/xmldsig-core-schema.xsd"/>

  <xsd:redefine schemaLocation="file:///E:/SQC/w3c/xenc-schema.xsd"></xsd:redefine>
 Remark: In our first attempt we imported in redefined-xenc.xsd the redefined-sig.xsd which causes name-collisions errors in the name-space of hhtp:www.....xenc#. So we changed the import-statement to import the original xmldsig-core-schema.xsd instead of the redefined-sig.xsd which results in a valid redefined-xenc.xsd. 

So our first questions is, why isn't it allowed to import the redefined xmldsig-core-schema.xsd in refefined-xenc.xsd.?

3. In the third step we construct a schema base.xsd which imports the redefined.sig.xsd and the redefined-xenc.xsd.
        <xsd:schema targetNamespace="http://www.test.de/2002/04/test" xmlns:test="http://www.osci.de/2002/04/test" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">

  <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="file:///E:/SQC/w3c/xml.xsd"/>
  <!-- Import der w3c-Schemata für Sig. und Encr.-->
  <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="file:///E:/SQC/w3c/xmldsig-core-schema.xsd"/>

  <xsd:import namespace="http://www.w3.org/2001/04/xmlenc#" schemaLocation="file:///E:/SQC/w3c/xenc-schema.xsd"/>-->
  <!-- import of the redef. Sig.- und Encr.-Schemata instead of the original w3c-Schemas -->
  <xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="file:///E:/SQC/test/redefined-sig.xsd"/>
  <xsd:import namespace="http://www.w3.org/2001/04/xmlenc#" schemaLocation="file:///E:/SQC/test/redefined-xenc.xsd"/>

During validation we get 49 name-collission- error in our target-namespace.
 See a cut-out of the error-messages below (complete error-messages are attached):

name collision in <schema targetNamespace="http://www.test.de/2002/04/test" >. The following components are defined more than once: complexType http://www.w3.org/2000/09/xmldsig#:CanonicalizationMethodType [ located at file:///e:/sqc/w3c/xmldsig-core-schema.xsd ] complexType http://www.w3.org/2000/09/xmldsig#:CanonicalizationMethodType [ located at file:///e:/sqc/w3c/xmldsig-core-schema.xsd ] . Suggested action: Change the names to be unique

We assume this is caused by the import statement of xdsig-core-schema.xsd in the xenc.schema.xsd.
In fact we obtain no name-collission-error if we redefine only the xenc-schema.xsd and use the original w3c xdsig-core-schema.xsd.

Recapitulating we obtain the following error-messages during validation:
1.       redefined-sig.xsd -----> valid

2.1.    redefined-enc.xsd with import of redefined-sig.xsd ---> name collissions of the complextypes defined in redefined-sig and xmldsig-coreschema

2.2     redefined-enc.xsd with import of xdsig-core-schema.xsd ---> valid, but in this case there no use to redefine xmldsig-core-schema.xsd    in our opinion

3.1     base.xsd with import of the xenc-schema and the xmldsig-core-schema.xsd --> valid, but no use for redefinements
3.2     order.xsd with import of the redefined schemas my-sig.xsd and my-enc.xsd ---> name collisions in the targetnamespace of bse.xsd.

Validation is done by the Schema Quality Checker from alphaworks.

In order to analyse the errors we defined own schemas to model the situation.
Therefore we defined a schema1.xsd as equivalent for xmldsig and a redefinement of it and a schema2.xsd as an equivalent of xenc and a redefinement of it. The corresponding schemas are atached to this mail.

With these schemas we obtain the same error-messages with respect of the name-collissions when imorting the redefineofschema1.xsd instead of schema1.xsd in redefineofschema2.xsd. But we get a correct validation when using the redefinements of schema 1 und 2 in another schema (schema3) with an own namespace in contrast to the situation with the signature/encryption.schemas..

Comprising we have the following  questions:
1. Why could we not import redefined-sig.xsd in redefined-xenc.xsd?
2. Why do we get the name-collisions when importing the redefined signature and encryption schemas in base.xsd.?
3. Why don't we get these errors when using our own schemas?

Thank you for your help and best regards,
<<own-model.zip>> <<zipped_redefinements_of_sig_xenc.zip>>




News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS