Skip to content

Deserializing attributes with a prefix (but no namespace behind it) fails #289

@boswelja

Description

@boswelja

I have some XML

<entry xml:lang="dut">Entry</entry>

Which notably has NO namespace definitions (or other langs)

and a corresponding data class

@Serializable
@XmlElement(value = true)
@SerialName(value = "entry")
data class Entry(
  @XmlElement(value = false)
  @SerialName(value = "xml:lang")
  @XmlSerialName(prefix = "xml", value = "lang")
  val lang: String = "eng"
)

I was expecting to see Entry.lang populated as dut for this example, but instead I get back eng, which is the default value. There are no errors thrown to indicate that the xml:lang attr couldn't be deserialized either.

I'm no expert in XML, am I missing something here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    indevThe issue is fixed/implemented in the dev branch

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions