buildingSMART / buildingSMART/IFC4.x-development

XSD File Issues

Open
#1,008 3 comments 0 reactions 0 assignees View on GitHub
ifc-update-out
Dominant language
Python
Stars
234
Forks
123
Avg merge
15h 4m
Merged PRs (30d)
5

Description

I also ran into this issue: https://github.com/buildingSMART/IFC4.3.x-development/issues/987#issuecomment-3291653276 and then changed to unbound/grabbed the latest dev version.

@aothms Since you asked, using the latest dev version IFC4X3_DEV_f498d15 file, I tried generating C# classes using https://github.com/mganss/XmlSchemaClassGenerator/

I've had success with this in the past with files like the Common Alerting Protocol: https://www.fema.gov/emergency-managers/practitioners/integrated-public-alert-warning-system/technology-developers/common-alerting-protocol

And here was the result:
```
Generated Type 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:IfcBinary' is not declared, or is not a simple type.
Generated Invalid content type derivation by restriction. If the derived content type is Empty, then the base content type should also be Empty or Mixed with Emptiable particle according to rule 5.3 of Schema Component Constraint: Derivation Valid (Restriction, Complex).
Generated Type 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:IfcCompoundPlaneAngleMeasure' is not declared, or is not a simple type.
Generated Type 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:IfcCompoundPlaneAngleMeasure' is not declared, or is not a simple type.
Generated Invalid particle derivation by restriction - 'Derived element 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:HasSubContexts' is not a valid restriction of base element 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:WorldCoordinateSystem' according to Elt:Elt -- NameAndTypeOK.'.
Generated Invalid particle derivation by restriction - 'Derived element 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:HasProperties' is not a valid restriction of base element 'https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:ParentProfile' according to Elt:Elt -- NameAndTypeOK.'.
Generated Invalid particle derivation by restriction - 'The derived element https://standards.buildingsmart.org/IFC/RELEASE/IFC4/3/DEV/f498d15:StyledByItem at (5315, 7) is not a valid restriction of the base sequence particle at (0, 0) according to Elt:All/Choice/Sequence -- RecurseAsIfGroup.'.
Generated Invalid particle derivation by restriction.
```

I'm generally looking to make C# classes from the XSD file since there isn't as much support for EXPRESS for this purpose and I've had success with XSD in the past.

I'd like to see some of these issues resolved or some guidance so I can create the C# class library.

Contributor guide

Open the contributing guide

Research direction

Start with the IFC4X3_DEV_f498d15 XSD and reproduce generation using XmlSchemaClassGenerator. Trace the undeclared types and invalid restriction messages in the generator output; done means the reported schema issues are resolved or clear guidance documents which constructs prevent C# generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, xml
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.