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

IDS file validation issues with schema v0.9 #113

Open
ciroraggio opened this issue Nov 4, 2022 · 8 comments
Open

IDS file validation issues with schema v0.9 #113

ciroraggio opened this issue Nov 4, 2022 · 8 comments
Labels
Milestone

Comments

@ciroraggio
Copy link

Trying to validate an IDS file (using schema 0.9) via Java, we get the error

no-xsi: The {target namespace} of an attribute declaration must not match 'http://www.w3.org/2001/XMLSchema-instance'.

Eliminating this import:
<xs:import namespace="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="XMLSchema-instance"/>
solves the problem.

@rubendel
Copy link
Contributor

rubendel commented Nov 4, 2022

See also #24 and #55

@CBenghi CBenghi added this to the 1.0 milestone May 31, 2023
@CBenghi
Copy link
Contributor

CBenghi commented May 31, 2023

The problem has been found both on Java and .NET implementation.
There's a concern that the initial hope that tooling would be helped by using the standard xml types does not yield benefits.

@CBenghi CBenghi mentioned this issue May 31, 2023
@berlotti berlotti removed the discuss label Jun 14, 2023
@berlotti
Copy link
Member

The combination of namespaces is valid XSD; not all tools support it.
We will create documentation on how to deal with it.

@JBreelKubus
Copy link

Any timeframe in which we can expect this documentation? It would be great to know which approach to take.

@berlotti
Copy link
Member

  • change the namespace of xs: to ids:
  • generate your classes
  • change the namespace back from ids to xs for the xsd components

@joshendriks
Copy link

joshendriks commented Jun 19, 2023

The combination of namespaces is valid XSD; not all tools support it.

It is perfectly fine to have multple namespace indeed. But this is something else. The curent IDS implementation uses typycal constructs that are normally used to validate a XSD. That is really confusing and IMO not intended to be used in XML.

There are a couple of signals to take into consideration:

  1. Multiple languages and frameworks have difficulty to deal with it
  2. As a human it is very hard to get your head around the fact that XMLSchema-instance is used to verify XML instead of an XSD

Both 1 and 2 make it more complex than needed and could have a negative impact on the adoption of IDS by the industry.

change the namespace of xs: to ids:
generate your classes
change the namespace back from ids to xs for the xsd components

If this imposed on developers who must interact with IDS, then I think the wrong decision is made.
I have worked with XML and XSD quite extensively in the past. I do even agree that it should be possible.
But knowing that multiple languages and frameworks do not support this out-of-the-box and that it causes additional cognitive load on the people working with this.... This to me really is a signal to rethink the current implementation.

There's a concern that the initial hope that tooling would be helped by using the standard xml types does not yield benefits.

I share that concern. I even think it will work against IDS to re-pupose standard XSD types in your XML.

Also I would be happy to help!

@andyward
Copy link
Contributor

As a human it is very hard to get your head around the fact that XMLSchema-instance is used to verify XML instead of an XSD

+1 - the use of XSD 'design-time' minoccurs / maxoccurs attributes the host the desired behaviour in the 'runtime' specification has always struck me as both conceptually wrong, and introducing unnecessary complexity in tooling, authoring, parsing and execution of the IDS, when all that's needed is a enumeration of Required/Prohibited/Optional etc.

Even if the thinking was this could also be extended for 'aggregate' restrictions in future (e.g. "There must be exactly 10 elements" => minoccurs=10 maxoccurs=10) ... it still feels semantically wrong, and won't support more sophisticated aggregates.

@CBenghi
Copy link
Contributor

CBenghi commented Oct 2, 2023

I would like to come to an agreement around this. Worth discussing in the calls.

I think most implementers agree that the use of the xs namespace in our implementation was not ideal, but most implementers have a working solution for 1.0 that would be a waste of efforts to change.

The proposed solution is to keep this solution for 1.0 and discuss changes and improvement to future versions.
This would mean to keep this issue open but retarget it for the next version.
The audit tool helps to enforce the agreed cardinality constraints for optional, required and prohibited.

@atomczak atomczak modified the milestones: 1.0, 1.1 Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants