We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i have a funny problem parsing COLLADA xml documents:
<skin source="#Cylinder_002-mesh"> <source id="Armature_JointBase_001-skin-joints"> .. </source> </skin>
And i is not clear how the Rust code has to look to parse something like this.
My naive approach was something like this:
#[derive(Deserialize)] pub struct Skin { #[serde(rename = "source")] pub sources: Vec<SkinSource>, } #[derive(Deserialize)] pub enum SkinSource { Source{id: String}, Attr(String), }
But this did not work.
The text was updated successfully, but these errors were encountered:
Since version 0.27.0 this is solved by prepending @ to the names of attributes. The original task can be solved by this types:
@
#[derive(Deserialize)] pub struct Skin { #[serde(rename = "@source")] pub source: String, #[serde(rename = "source")] pub sources: Vec<SkinSource>, } #[derive(Deserialize)] pub struct SkinSource { #[serde(rename = "@id")] id: String, }
Fixed by #490.
Sorry, something went wrong.
Mingun
No branches or pull requests
i have a funny problem parsing COLLADA xml documents:
And i is not clear how the Rust code has to look to parse something like this.
My naive approach was something like this:
But this did not work.
The text was updated successfully, but these errors were encountered: