Skip to content
New issue

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

problems with colon separators #591

Closed
unshakable-horse opened this issue Apr 12, 2023 · 1 comment
Closed

problems with colon separators #591

unshakable-horse opened this issue Apr 12, 2023 · 1 comment
Labels
namespaces Issues related to namespaces support serde Issues related to mapping from Rust types to XML

Comments

@unshakable-horse
Copy link

fn main() {
    let xml = r#"<p:sldLayoutIdLst>
        <p:sldLayoutId id="2147483649" r:id="rId1"/>
        <p:sldLayoutId id="2147483650" r:id="rId2"/>
    </p:sldLayoutIdLst>"#;
    let result:CtSlideLayoutIdList = quick_xml::de::from_str(xml).unwrap();
    println!("{:?}",quick_xml::se::to_string(&result));
}

#[derive(Serialize,Deserialize,Debug)]
#[serde(rename(serialize = "p:sldLayoutIdLst", deserialize = "sldLayoutIdLst"))]
pub struct CtSlideLayoutIdList {
    #[serde(rename(serialize = "p:sldLayoutId", deserialize = "sldLayoutId"))]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sld_layout_id: Option<Vec<CtSlideLayoutIdListEntry>>,
}



#[derive(Serialize,Deserialize,Debug)]
pub struct CtSlideLayoutIdListEntry{
    #[serde(rename="@id")]
    pub id_attr:Option<String>,

    #[serde(rename="@r:id")]
    pub r_id_attr:Option<String>,
}

i got an error "thread 'main' panicked at 'called Result::unwrap() on an Err value: Custom("duplicate field @id")'"

@Mingun Mingun added serde Issues related to mapping from Rust types to XML namespaces Issues related to namespaces support labels Apr 12, 2023
@Mingun
Copy link
Collaborator

Mingun commented Apr 12, 2023

Namespaces does not supported yet with serde. Duplicate of #218.

@Mingun Mingun closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
namespaces Issues related to namespaces support serde Issues related to mapping from Rust types to XML
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants