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

Is xs:sequence intended? #175

Closed
Moult opened this issue Jul 21, 2023 · 10 comments
Closed

Is xs:sequence intended? #175

Moult opened this issue Jul 21, 2023 · 10 comments
Assignees
Labels
schema Issues that impact the schema file

Comments

@Moult
Copy link
Contributor

Moult commented Jul 21, 2023

Because xs:sequence is used, that means that the description element must be exactly in that position and in no other. Is this intentional? Sounds like it's just a pain with no real meaning.

I've noticed others and most recently IfcOpenShell/IfcOpenShell#3476 who seem to write IDSes by hand run into this problem.

@berlotti
Copy link
Member

According to my XMLSpy validation this is the only valid way to construct the XSD. I think it has to do with the reuse of parts of the schema.
If we can get it in random order but still have valid XSD I'm happy to change it.

@andyward
Copy link
Contributor

Sounds like it should be xs:all with the appropriate min/maxOccurs?

all: The elements can occur in any order. https://www.w3.org/TR/xmlschema11-1/#element-all

@NiklasPor
Copy link

I can only second @andyward. I was very confused when I came across this while giving a TS implementation a try. If the order isn't adding any value please us xs:all, otherwise it'll take extra effort in all implementations to keep the xml tags in the right order 👍

@berlotti
Copy link
Member

ok; looking for feedback from others as well

@SergejMuhic
Copy link

Sounds like a good suggestion if random order is intended.

I do like seeing the nodes in the same order in files though. Also makes it easy to query by index.

@CBenghi
Copy link
Contributor

CBenghi commented Sep 21, 2023 via email

@NiklasPor
Copy link

@SergejMuhic FYI querying by index might be dangerous, as a lot of the items in the sequences are optional (marked with minOccurs=0).

@SergejMuhic
Copy link

@SergejMuhic FYI querying by index might be dangerous, as a lot of the items in the sequences are optional (marked with minOccurs=0).

Missed that. I will not query by index! 😄

@CBenghi CBenghi added the schema Issues that impact the schema file label Oct 3, 2023
@CBenghi CBenghi self-assigned this Oct 3, 2023
@CBenghi
Copy link
Contributor

CBenghi commented Oct 3, 2023

xs:sequence is used in many places across the schema. Are we intending to replace it everywhere with xs:all?

@CBenghi
Copy link
Contributor

CBenghi commented Oct 3, 2023

In the call we have identified some value of keeping sequences in order:

  • Comparing two versions of the file
  • Producing text version of the content in a reliable and consistent way

So the decision is to keep the sequence elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema Issues that impact the schema file
Projects
None yet
Development

No branches or pull requests

6 participants