From 174eea5e5d6e8b087d4c61018578802d2fac9e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Tue, 22 Apr 2025 17:52:35 +0200 Subject: [PATCH] xso: clarify behaviour when two fields match the same xml attribute --- xso/src/from_xml_doc.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xso/src/from_xml_doc.md b/xso/src/from_xml_doc.md index 7d62ee567c8c33f1f077d25a098dec2dab25094a..a4a6854c156579a49ff416519b236203b3bd8391 100644 --- a/xso/src/from_xml_doc.md +++ b/xso/src/from_xml_doc.md @@ -323,6 +323,14 @@ field type on which the `extract` is declared. If `codec` is given, the given `codec` value must implement [`TextCodec`][`TextCodec`] where `T` is the type of the field. +If two (or more) `#[xml(attribute)]` metas match the same XML attribute, +unspecified behavior occurs during serialisation: only one of the values will +be in the output, but it is unspecified which of the two. (Due to indirections +when refering to `static` items for attribute namespaces and names, it is not +possible to check this at compile-time.) This behaviour also affects +attribute fields which match the special `xml:lang` attribute when used in +conjuction with a `#[xml(lang)]` field. + #### Example ```rust