buildingSMART / IDS

Computer interpretable (XML) standard to define Information Delivery Specifications for BIM (mainly used for IFC)
https://www.buildingsmart.org/standards/bsi-standards/information-delivery-specification-ids/
Other
206 stars 62 forks source link

Is xs:sequence intended? #175

Closed Moult closed 1 year ago

Moult commented 1 year ago

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 https://github.com/IfcOpenShell/IfcOpenShell/issues/3476 who seem to write IDSes by hand run into this problem.

berlotti commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

ok; looking for feedback from others as well

SergejMuhic commented 1 year ago

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 commented 1 year ago

There's no semantic need for constraining the order.

I second the schema change that Andy suggests. It is more tolerant, but retains backwards compatibility.

On Thu, Sep 21, 2023, 17:26 SergejMuhic @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/buildingSMART/IDS/issues/175#issuecomment-1729811867, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJY7MLBLEF3HVVTEZN3Z5TX3RMDPANCNFSM6AAAAAA2SOTYBM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

NiklasPor commented 1 year ago

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

SergejMuhic commented 1 year ago

@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 commented 1 year ago

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

CBenghi commented 1 year ago

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

So the decision is to keep the sequence elements.