serde-xml-rs
serde-xml-rs copied to clipboard
Help with deserializing/serializing
Hi!, I have a xml file with a structure like this
<?xml version="1.0" encoding="utf-8"?>
<Preferences Prop1="value1" Prop2="value2" />
I'd like to change the value of "Prop2" to something else and then write to another file
How would I do this, I tried Deserializing like this
serde_xml_rs::from_str::<HashMap<String, String>>(&xml_string)?
that gives me the values but I can't serialize it again into the same format, It comes out as
<Prop1>
value1
</Prop1>
<Prop2>
value2
</Prop2>
I dont want to make a struct since there are few hundred properties in the file and I only need to change 1 or 2