Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLSchemaParseError: multiple declaration of attribute 'resp' in XML Schema 1.1 file #276

Closed
yngwi opened this issue Dec 6, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@yngwi
Copy link

yngwi commented Dec 6, 2021

Hi,
I'm trying to validate documents against a complex XML Schema v1.1 file but I'm getting an error when creating the XMLSchema11 instance:

xmlschema.validators.exceptions.XMLSchemaParseError: multiple declaration of attribute 'resp':

Schema:

  <xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" mixed="true">
     <xs:attributeGroup ref="lang" />
     <xs:attributeGroup ref="standard" />
     <xs:attributeGroup ref="resp" />
  </xs:complexType>

Path: /xs:schema/xs:element[10]/xs:complexType

The file seems to be correct and works fine when using it to validate documents in Oxygen-XML. Any input to what might happen or help me resolve this problem is greatly appreciated.

Best,
Daniel

@brunato brunato added the bug Something isn't working label Dec 6, 2021
@brunato
Copy link
Member

brunato commented Dec 7, 2021

Hi,
this is a bug on parsing schema attributes. The attribute is the same object so in this case shouldn't be considered a duplicate.
I'll put the fix in next bugfix release. Until that you could parse the schema providing validation='lax'.

Thank you

@yngwi
Copy link
Author

yngwi commented Dec 7, 2021

Thank you very much, works like a charm!

@yngwi yngwi closed this as completed Dec 7, 2021
brunato added a commit that referenced this issue Dec 8, 2021
  - Do not consider an error if duplicate is the same object
@brunato
Copy link
Member

brunato commented Dec 9, 2021

Hi,
with new release v1.9.1 it should work also with default validation mode.

@yngwi
Copy link
Author

yngwi commented Dec 10, 2021

I just tried it, indeed, it works. Thank you for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants