3MFConsortium / lib3mf

lib3mf is an implementation of the 3D Manufacturing Format file standard
http://3mf.io
BSD 2-Clause "Simplified" License
237 stars 94 forks source link

XML attribute normalization is missing #288

Open bubnikv opened 2 years ago

bubnikv commented 2 years ago

lib3mf could read the XML attribute values it writes, however it seems to not implement XML attribute normalization: https://www.w3.org/TR/REC-xml/#AVNormalize

Namely, if a XML attribute value contains newlines or tabs, these newlines or tabs are replaced by libexpat by spaces after parsing and before passing to an application due to the mandatory normalization as shown by the following table from the XML norm:

image

Please note that an attribute type is considered CDATA by default.

bubnikv commented 2 years ago

And by the way, none of the XML parsers / writers that I checked (boost property tree, boost serialization, tinyxml) seem to implement normalization.

Also if a producer escapes newlines with &#xD, it seems that lib3mf will NOT unescape such sequence.