buildingSMART / buildingSMART/IFC4.x-development
IfcXML list-of-values serialization for string derived simple types
- Dominant language
- Python
- Stars
- 234
- Forks
- 123
- Avg merge
- 15h 4m
- Merged PRs (30d)
- 5
Description
As you're probably aware in IFC4 we introduced several shortcuts in the serialization of step-xml by means of the tagless list-of-values configuration option.
### ifc2x3
~~~xml
~~~
### ifc4
~~~xml
~~~
Small difference in XSD, but big difference in XML because the xs:list here is merely a space delimited value of an attribute and xs:sequence would give you a full tag-decorated sequence of child nodes.
I'm somewhat surprised though to see this also applied in string-based attributes such as `MiddleNames` on `IfcPerson`.
~~~xml
~~~
The part 28 text is of course a bit vague on this:
> By definition, all representations of the data types BOOLEAN, INTEGER, LOGICAL, NUMBER, and REAL do not
> contain whitespace, and the XML list form – tokens separated by whitespace – is an unambiguous
> representation.
> NOTE 2 When the base-type of the EXPRESS aggregation data type is STRING or BINARY, or a defined data
> type whose fundamental type is STRING or BINARY, 8.2.2.2 generally applies, but this subclause applies when
> specified by Table 3.
So my summary don't use this representation form on strings unless specified in Table 3. The note under Table 3 says:
> NOTE 4 As specified in 10.2.8, tagless="true" shall not be specified unless the base-type is one of the following:
>
> — a simple type as defined above,
> — a STRING data type whose values **will not contain whitespace**,
I didn't really understand when it is sufficiently established when a *STRING data type will not contain whitespace*. Maybe whitespace in a middle name is unlikely, but IfcLabel in itself will not prevent this so we end up with an ambiguous serialization.
My proposal. Never use list-of-values on any string-based type. Not even IfcIdentifier.
Contributor guide
Assessment
This issue has not been assessed yet.