JoystickGremlin
JoystickGremlin copied to clipboard
Question: Inline XML Comments (which won't dissappear after save)
I'm trying to come up with a method to add inline comments to my .xml profiles that will stick around after saves through the GUI. I've already tried the standard syntax, which admittedly doesn't give an error on loading, but is omitted from the next save. Any help is appreciated.
Short answer, this won't work no matter what you try. The way profiles are used is:
- Loading: XML -> Python objects
- Saving: Python objects -> XML
As such any comments that might exist in the XML are removed as loading doesn't care about them, and the Python objects have no notion of comments.
One way around this could be to use the Description
action which is just a text field that can contain whatever you want.
I'd guessed this was the case, but figured it was worth a shot. I've been using Descriptions which works for most of my use cases. I was hoping for inline comments for a few niche cases, such as particularly long macros (logic flag initializers and the like). Thanks for the reply, WM.