DanielT / autosar-data

A rust crate to work with Autosar data (arxml) files
Apache License 2.0
35 stars 11 forks source link

XML parser: single-quote delimited attribute values silently lost #23

Closed FlTr closed 1 month ago

FlTr commented 1 month ago

Attributes with their values delimited in single-quotes are lost during loading files. They neither appear in the loaded model nor when serialized again.

<DEFINITION-REF DEST="ECUC-MODULE-DEF">/AUTOSAR_A</DEFINITION-REF>

versus

<DEFINITION-REF DEST='ECUC-MODULE-DEF'>/AUTOSAR_A</DEFINITION-REF>

As of xml specification, single quotes are allowed.

Definition: the content of the AttValue (the text between the ' or " delimiters) as the attribute value.

https://www.w3.org/TR/xml/#sec-starttags https://www.w3.org/TR/xml/#NT-AttValue

DanielT commented 1 month ago

Thanks for the bug report!

The fact that attributes in single quotes didn't work is clearly a bug, though I've never seen a file that was written that way. I also dislike the fact that it failed silently.

I have fixed both in the commit I just pushed.