[Libosinfo] [PATCH 1/4] schema: make various elements optional

Daniel P. Berrange berrange at redhat.com
Tue Oct 20 13:02:33 UTC 2015


A number of places in the schema use <oneOrMore>. While this
is correct when considering an XML file that defines a complete
entity, it is incorrect for XML files that are just augmenting
an existing entity. Change them to use <zeroOrMore> where we
need to allow augmentation.
---
 data/schemas/libosinfo.rng | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
index b97e1cb..51eb80a 100644
--- a/data/schemas/libosinfo.rng
+++ b/data/schemas/libosinfo.rng
@@ -48,7 +48,7 @@
         <ref name='url'/>
       </attribute>
       <interleave>
-        <oneOrMore>
+        <zeroOrMore>
           <element name='name'>
             <optional>
               <attribute name='xml:lang'>
@@ -57,7 +57,7 @@
             </optional>
             <text/>
           </element>
-        </oneOrMore>
+        </zeroOrMore>
         <optional>
           <element name='bus-type'>
             <choice>
@@ -129,7 +129,7 @@
 
   <define name="product-content">
     <interleave>
-      <oneOrMore>
+      <zeroOrMore>
         <element name='vendor'>
           <optional>
             <attribute name='xml:lang'>
@@ -138,8 +138,8 @@
           </optional>
           <text/>
         </element>
-      </oneOrMore>
-      <oneOrMore>
+      </zeroOrMore>
+      <zeroOrMore>
         <element name='name'>
           <optional>
             <attribute name='xml:lang'>
@@ -148,12 +148,12 @@
           </optional>
           <text/>
         </element>
-      </oneOrMore>
-      <oneOrMore>
+      </zeroOrMore>
+      <zeroOrMore>
         <element name='short-id'>
           <text/>
         </element>
-      </oneOrMore>
+      </zeroOrMore>
       <optional>
         <element name='version'>
           <text/>
@@ -491,13 +491,13 @@
           <text/>
         </element>
       </zeroOrMore>
-      <oneOrMore>
+      <zeroOrMore>
         <element name='device'>
           <attribute name='id'>
             <ref name='url'/>
           </attribute>
         </element>
-      </oneOrMore>
+      </zeroOrMore>
     </element>
   </define>
 
-- 
2.4.3




More information about the Libosinfo mailing list