by baz00 · 3y ago · 0 comments
This one bit me recently. Parse it and see what happens.
- yaml:
- 01
- 08
This one works as expected: <list>
<value>01</value>
<value>08</value>
</list>
And I can qualify it <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="value" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema> - yaml:
- '01'
- '08'
Complaining about this is like complaining that { json: [01, 08] }
will be interpreted as [1, 8] in json... It's not a problem with the tool, it's a user error.The JSON format avoids this problem because it requires that all strings be quoted. If you start with `["09", "08"]` and change one of the digits inside the quotes, the string will stay a string. In JSON, strings becoming not-strings – removal of quotes or addition of backslash escaping – is more obvious than in YAML.