[elbe-devel] [PATCH] schema: set raw-preference to maxOccurs=1

John Ogness john.ogness at linutronix.de
Fri Jul 20 14:58:45 CEST 2018


On 2018-07-12, Manuel Traut <manut at linutronix.de> wrote:
> currently the element can be inserted multiple times, the code handles
> this correctly. However it avoids using the out 'all' tag instead of
> 'sequence' because 'all' just allows maxOccurs=1. Having a less strict
> ordering in XML seems for me more useful than multiple occurance of the
> rarely documented 'raw-preference' element. However this is a change of
> the schema that makes it incompatible with the old one.

Since the raw-preference element supports multi-line data, there is no
benefit to supporting more than 1 occurrence.

>
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: John Ogness <john.ogness at linutronix.de>

> ---
>  schema/dbsfed.xsd | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
> index 3e1d3157..eaf707f1 100644
> --- a/schema/dbsfed.xsd
> +++ b/schema/dbsfed.xsd
> @@ -384,7 +384,7 @@
>          rootfilesystem and include the definition of the build environment
>        </documentation>
>      </annotation>
> -    <sequence>
> +    <all>
>        <element name="name" type="rfs:string" minOccurs="0">
>          <annotation>
>            <documentation>
> @@ -435,7 +435,7 @@
>            </documentation>
>          </annotation>
>        </element>
> -      <element name="raw-preference" type="rfs:raw-preference" minOccurs="0" maxOccurs="unbounded">
> +      <element name="raw-preference" type="rfs:raw-preference" minOccurs="0">
>          <annotation>
>            <documentation>
>              gets dedented and striped and is then written to /etc/apt/preferences
> @@ -467,7 +467,7 @@
>            </documentation>
>          </annotation>
>        </element>
> -    </sequence>
> +    </all>
>      <attribute ref="xml:base"/>
>    </complexType>



More information about the elbe-devel mailing list