Skip to content

Conflict with multiple elements with the same name but different prefixes #186

@mtorromeo

Description

@mtorromeo

Hi,
I'm trying to deserialize an XML which have multiple elements with the same name but defined in different namespaces and consequently using different prefixes.

The actual XSDs are rather complex, but the problem can be illustrated with this snippet:

<error>
  <reasonCode>1</reasonCode>
  <ext:reasonCode>1234</ext:reasonCode>
</error>

which I tried implementing with this struct:

pub struct ErrorType {
    #[yaserde(rename = "reasonCode", prefix = "myns")]
    pub reason_code: Option<u16>,
    #[yaserde(rename = "reasonCode", prefix = "ext")]
    pub ext_reason_code: Option<u16>,
}

but this results in the following error:

error[E0428]: the name `__Visitor_ReasonCode_` is defined multiple times

Is this supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions