xso-proc: Add the default flag to the element meta

This allows the payload to be absent, and requires the field type to be
Option<minidom::Element>.
This commit is contained in:
Emmanuel Gil Peyrot 2024-12-20 18:41:39 +01:00 committed by Jonas Schäfer
commit 1823afbc71
6 changed files with 107 additions and 6 deletions

View file

@ -406,7 +406,12 @@ fn new_field(
}
#[cfg(feature = "minidom")]
XmlFieldMeta::Element { span, amount } => Ok(Box::new(ElementField {
XmlFieldMeta::Element {
span,
default_,
amount,
} => Ok(Box::new(ElementField {
default_,
amount: amount.unwrap_or(AmountConstraint::FixedSingle(span)),
})),