serde-xml-rs
serde-xml-rs copied to clipboard
duplicate field `$value`'
I am processing the following file. https://github.com/KhronosGroup/OpenGL-Registry/blob/main/xml/gl.xml
It has lines such as this:
<proto><ptype>GLVULKANPROCNV</ptype> <name>glGetVkProcAddrNV</name></proto>
<proto>void <name>glWaitVkSemaphoreNV</name></proto>
So I would like to sometimes extract the string under proto, or the ptype, but always get the name, as it is always present. However:
#[derive(Debug, Deserialize, PartialEq)]
struct Proto {
#[serde(rename = "$value")]
return_type: String,
ptype: Option<String>,
name: String,
}
Doesn't work. Is there a way to state that return_type should only have the non-fields of the xml member proto?
This crate doesn't currently support mixed content text and elements.