buildingSMART / IDS-Audit-tool

Official buildingSMART tool to audit the validity of a .ids file (according to the full IDSxml standard).
MIT License
19 stars 8 forks source link

Incorrect error when specifying a Property value and omitting a dataType #43

Open andyward opened 2 months ago

andyward commented 2 months ago

See https://github.com/buildingSMART/IDS/issues/331#issuecomment-2225619660 and https://github.com/buildingSMART/IDS/issues/337

Seems there's been some back and forth over whether dataType is mandatory when specifying a property value. Currently validating an IDS such as

<ids:ids xmlns:ids="http://standards.buildingsmart.org/IDS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://standards.buildingsmart.org/IDS http://standards.buildingsmart.org/IDS/1.0/ids.xsd">
    <ids:info>
        <ids:title>Test of conformity</ids:title>
    </ids:info>
    <ids:specifications>
        <ids:specification name="Spaces have correct OccupancyType value" ifcVersion="IFC2X3">
            <ids:applicability>
                <ids:entity>
                    <ids:name>
                        <ids:simpleValue>IFCSPACE</ids:simpleValue>
                    </ids:name>
                </ids:entity>
            </ids:applicability>
            <ids:requirements>
                <ids:property><!-- No dataType specified -->
                    <ids:propertySet>
                        <ids:simpleValue>Pset_SpaceOccupancyRequirements</ids:simpleValue>
                    </ids:propertySet>
                    <ids:baseName>
                        <ids:simpleValue>OccupancyType</ids:simpleValue>
                    </ids:baseName>
                    <ids:value>
                        <ids:simpleValue>9.2</ids:simpleValue>
                    </ids:value>
                </ids:property>
            </ids:requirements>
        </ids:specification>
    </ids:specifications>
</ids:ids>

... will give a warning

info: idsTool.Program[0] Auditing: Ids structure, Ids content.
info: idsTool.Program[0] Auditing file: `.../space.ids`.
info: idsTool.Program[0] The file schema version is: Ids1_0
[**omitted other warnings in this file**]
fail: idsTool.Program[0] Error 203: Incompatible constraints on `property` element at line X, position Y, specifiying a 'value' requires a 'dataType'.
...

According to @CBenghi's comment in https://github.com/buildingSMART/IDS/issues/206#issuecomment-1923702315 it's now optional.