ADT #1844909: Tweak XML schema, add more tests.
Change XML schema to allow for empty <libs>, e.g. one can create and add-on that doesn't declare any extra lib. However enforce that <archives> contains at least one <archive> element to prevent someone from declaring a download element that cannot actually be downloaded. Added a couple tests for validation of empty documents.
This commit is contained in:
@@ -86,9 +86,11 @@
|
||||
<xsd:element name="desc-url" type="xsd:token" minOccurs="0" />
|
||||
<xsd:element name="archives" type="sdk:archivesType" />
|
||||
|
||||
<!-- An add-on can declare 0 or more libraries. -->
|
||||
|
||||
<xsd:element name="libs">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence maxOccurs="unbounded">
|
||||
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
|
||||
<xsd:element name="lib">
|
||||
<xsd:complexType>
|
||||
<xsd:all>
|
||||
@@ -135,13 +137,16 @@
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<!-- A collection of files that can be downloaded for a given architectures -->
|
||||
<!-- A collection of files that can be downloaded for a given architecture.
|
||||
The <archives> node is mandatory in the repository elements and the
|
||||
collection must have at least one <archive> declared.
|
||||
-->
|
||||
|
||||
<xsd:complexType name="archivesType">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>A collection of architecture-dependent archives.</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:sequence maxOccurs="unbounded">
|
||||
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
|
||||
<!-- One archive file -->
|
||||
<xsd:element name="archive">
|
||||
<xsd:complexType>
|
||||
|
||||
Reference in New Issue
Block a user