[Bug] XML file (input) and XML Exporter inconsistent

 

When I'm loading an XML file
(well... in this case an .xcomp, which is XML at the end of the day... :-))
and pipe it directly into an XML Exporter to write it out with a different filename,
Axy does not understand the newly created file.

A quick look shows that even when there are no changes made to the XML
(as said before.. direct In/Out workflow)
the code itself gets changed by the Exporter. e.g. the original

<Parameter type="ArrChannelParams">
<PreviewChannels type="dictionary">
<item key="1" type="Int32" value="5" />
<item key="2" type="Int32" value="5" />
<item key="5" type="Int32" value="5" />
</PreviewChannels>

becomes

<Parameter type="ArrChannelParams">
<PreviewChannels type="dictionary">
<1 type="Int32" value="5" />
<2 type="Int32" value="5" />
<5 type="Int32" value="5" />
</PreviewChannels>

on export...

   EricWest

 
Profile Image
EricWest
  -  

PS: Why would I do that?

Because I thought that it would be a smart way to get around the 'renaming of input pins issue' described here:
https://my.aximmetry.com/post/2013-feature-request-rename-pins-remotely

Which (in theory) seems to work apart from the inconsistent naming described in this ticket.

 
Profile Image
Eifert@Aximmetry
  -  

Hi Eric,

It is because the special "key" name: <item key="1" type="Int32" value="5" />
It will work correctly if you use anything else than "key" there.
You can expect this to become an optional behavior in a future release of Aximmetry. The behavior was designed for ease of use with Aximmetry's own data structure.

Warmest regards,

 
Profile Image
EricWest
  -  

Hi Eifert.

Thanks for the explanation.
That 'special' key name is part of Axy's xcomp files, so it would be awesome if one could read, parse, modify, and write them directly... :-)

Looking forward to the next update... :-)

Cheers & all the best.

Eric.


 
Profile Image
Eifert@Aximmetry
  -  

Hi Eric,

A pin has been added to the XML file module to handle this issue in the Aximmetry version 2022.3.0, which has been released today:
Added Use Key Attr property to XML File and XML Text modules to enable controlling the usage of the "key" attributes found in the XML as the collection key instead of the section name. It is ON by default for backward compatibility.

You might also be interested in the following fixes related to XML in version 2022.3.0:
Fixed that XML/JSON File/Text modules did not always reflect content changes when they were only connected to an XML/JSON Exporter module.

Fixed that XML Exporter incorrectly exported certain special characters.

Warmest regards,

 
Profile Image
EricWest
  -  

Hi Eifert.

That's great news! Thanks for incorporating that fix!

Cheers & all the best.

Eric.


;