buildingSMART / buildingSMART/IDS
numeric simpleValue
- Dominant language
- C#
- Stars
- 318
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Let's say I want the value of a length property to be exactly 2.0. I would use ``, but it technically only accepts strings.
[ids.xsd#L41](https://github.com/buildingSMART/IDS/blob/b12e39224c35dac92f9adff068eb0cba74134621/Schema/ids.xsd#L41C4-L41C81):
``
When I try to convert python data to IDS using xml.etree Python package, it says:
```
File "...\site-packages\xmlschema\validators\xsdbase.py", line 249, in validation_error raise error
xmlschema.validators.exceptions.XMLSchemaEncodeError: failed validating 2.0 with XsdAtomicBuiltin(name='xs:string'):
Reason: 2.0 is not an instance of
```
So the implementers have to remember to cast all alphanumeric values to strings. I think we could improve the schema by replacing the abovementioned line with union type also allowing numbers:
```
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Open Schema/ids.xsd around line 41 and review how simpleValue is currently typed. Reproduce the reported xmlschema validation failure with a numeric Python value, then check that numeric and string values both validate and that the existing schema tests or validation workflow pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, xml
- Domain
- data
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100