xso-proc: add support for string literals for namespaces

Makes it easier to use ad-hoc.
This commit is contained in:
Jonas Schäfer 2024-06-22 09:30:45 +02:00
commit 2efef5ceeb
3 changed files with 46 additions and 13 deletions

View file

@ -169,3 +169,17 @@ fn name_path_roundtrip() {
};
roundtrip_full::<NamePath>("<bar xmlns='urn:example:ns1'/>");
}
#[derive(FromXml, IntoXml, PartialEq, Debug, Clone)]
#[xml(namespace = "urn:example:ns2", name = "baz")]
struct NamespaceLit;
#[test]
fn namespace_lit_roundtrip() {
#[allow(unused_imports)]
use std::{
option::Option::{None, Some},
result::Result::{Err, Ok},
};
roundtrip_full::<NamespaceLit>("<baz xmlns='urn:example:ns2'/>");
}