Skip to content

Commit d6c113b

Browse files
authored
Merge pull request #22 from Michalzr/fix/more-strict-schema
Improve validation of "count" fields and introduce "components" wrapper element
2 parents bd38a2b + a1fdaf2 commit d6c113b

File tree

1 file changed

+65
-59
lines changed

1 file changed

+65
-59
lines changed

schema/pvcollada_schema_0.1.xsd

Lines changed: 65 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
184184
<xs:documentation>MPPT description data.</xs:documentation>
185185
</xs:annotation>
186186
<xs:sequence>
187-
<xs:element name="input_count" type="xs:int">
187+
<xs:element name="input_count" type="xs:positiveInteger">
188188
<xs:annotation>
189189
<xs:documentation>Number of parallel strings that can be connected to MPPT.</xs:documentation>
190190
</xs:annotation>
@@ -248,7 +248,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
248248
<xs:documentation>Maximum DC current, A.</xs:documentation>
249249
</xs:annotation>
250250
</xs:element>
251-
<xs:element name="mppt_count" type="xs:float" minOccurs="0">
251+
<xs:element name="mppt_count" type="xs:positiveInteger" minOccurs="0">
252252
<xs:annotation>
253253
<xs:documentation>Number of MPPTs.</xs:documentation>
254254
</xs:annotation>
@@ -342,7 +342,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
342342
<xs:documentation>Combiner model name.</xs:documentation>
343343
</xs:annotation>
344344
</xs:element>
345-
<xs:element name="input_count" type="xs:int">
345+
<xs:element name="input_count" type="xs:positiveInteger">
346346
<xs:annotation>
347347
<xs:documentation>Number of inputs to combiner.</xs:documentation>
348348
</xs:annotation>
@@ -361,7 +361,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
361361
<xs:documentation>Combiner model name.</xs:documentation>
362362
</xs:annotation>
363363
</xs:element>
364-
<xs:element name="input_count" type="xs:int">
364+
<xs:element name="input_count" type="xs:positiveInteger">
365365
<xs:annotation>
366366
<xs:documentation>Number of inputs to combiner.</xs:documentation>
367367
</xs:annotation>
@@ -445,7 +445,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
445445
<xs:documentation>Cross-section area, sq. mm</xs:documentation>
446446
</xs:annotation>
447447
</xs:element>
448-
<xs:element name="num_conductors" type="xs:float">
448+
<xs:element name="num_conductors" type="xs:positiveInteger">
449449
<xs:annotation>
450450
<xs:documentation>Number of conductors</xs:documentation>
451451
</xs:annotation>
@@ -506,7 +506,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
506506
</xs:complexType>
507507
<!-- Inputs container for instance_transformer; each input must be either transformer, AC combiner or inverter -->
508508
<xs:complexType name="transformer_inputs_type">
509-
<xs:choice minOccurs="1" maxOccurs="unbounded">
509+
<xs:choice maxOccurs="unbounded">
510510
<xs:element name="instance_transformer" type="instance_transformer_type" />
511511
<xs:element name="instance_combiner_ac" type="instance_combiner_ac_type" />
512512
<xs:element name="instance_inverter" type="instance_inverter_type" />
@@ -524,7 +524,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
524524
</xs:complexType>
525525
<!-- Inputs container for instance_combiner_ac; each input must must be either transformer, AC combiner or inverter) -->
526526
<xs:complexType name="combiner_ac_inputs_type">
527-
<xs:choice minOccurs="1" maxOccurs="unbounded">
527+
<xs:choice maxOccurs="unbounded">
528528
<xs:element name="instance_transformer" type="instance_transformer_type" />
529529
<xs:element name="instance_combiner_ac" type="instance_combiner_ac_type" />
530530
<xs:element name="instance_inverter" type="instance_inverter_type" />
@@ -543,12 +543,12 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
543543
<!-- mppts container: must have one or more mppt elements -->
544544
<xs:complexType name="mppts_type">
545545
<xs:sequence>
546-
<xs:element name="mppt" type="mppt_type" minOccurs="1" maxOccurs="unbounded" />
546+
<xs:element name="mppt" type="mppt_type" maxOccurs="unbounded" />
547547
</xs:sequence>
548548
</xs:complexType>
549549
<!-- mppt element: contains one or more "string" and "instance_combiner_dc" elements -->
550550
<xs:complexType name="mppt_type">
551-
<xs:choice minOccurs="1" maxOccurs="unbounded">
551+
<xs:choice maxOccurs="unbounded">
552552
<xs:element name="string" type="string_type" />
553553
<xs:element name="instance_combiner_dc" type="instance_combiner_dc_type" />
554554
</xs:choice>
@@ -565,7 +565,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
565565
</xs:complexType>
566566
<!-- Inputs container for instance_combiner_Dc; each input must be either DC combiner or string) -->
567567
<xs:complexType name="combiner_dc_inputs_type">
568-
<xs:choice minOccurs="1" maxOccurs="unbounded">
568+
<xs:choice maxOccurs="unbounded">
569569
<xs:element name="instance_combiner_dc" type="instance_combiner_dc_type" />
570570
<xs:element name="string" type="string_type" />
571571
</xs:choice>
@@ -574,7 +574,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
574574
and exactly one inputs child that contains one or more input children (each wrapping a module_layout) -->
575575
<xs:complexType name="instance_optimizer_type">
576576
<xs:sequence>
577-
<xs:choice minOccurs="1" maxOccurs="2">
577+
<xs:choice maxOccurs="2">
578578
<xs:element name="cable_to_parent" type="cable_to_type" />
579579
<xs:element name="cable_to_neighbor" type="cable_to_type" />
580580
</xs:choice>
@@ -594,7 +594,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
594594
<!-- Inputs container for instance_optimizer elements: It must appear exactly once and contain one or more 'module_layout' children -->
595595
<xs:complexType name="optimizer_inputs_type">
596596
<xs:sequence>
597-
<xs:element name="module_layout" type="module_layout_type" minOccurs="1" maxOccurs="unbounded" />
597+
<xs:element name="module_layout" type="module_layout_type" maxOccurs="unbounded" />
598598
</xs:sequence>
599599
</xs:complexType>
600600
<!-- The "string" element must contain exactly one child which is either a module_array or an optimizer_array -->
@@ -608,19 +608,19 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
608608
<!-- optimizer_array: contains one or more instance_optimizer elements -->
609609
<xs:complexType name="optimizer_array_type">
610610
<xs:sequence>
611-
<xs:element name="instance_optimizer" type="instance_optimizer_type" minOccurs="1" maxOccurs="unbounded" />
611+
<xs:element name="instance_optimizer" type="instance_optimizer_type" maxOccurs="unbounded" />
612612
</xs:sequence>
613613
</xs:complexType>
614614
<!-- module_array: contains one or more module_layout elements -->
615615
<xs:complexType name="module_array_type">
616616
<xs:sequence>
617-
<xs:element name="module_layout" type="module_layout_type" minOccurs="1" maxOccurs="unbounded" />
617+
<xs:element name="module_layout" type="module_layout_type" maxOccurs="unbounded" />
618618
</xs:sequence>
619619
</xs:complexType>
620620
<!-- module_layout: must have at least one cable (either cable_to_parent or cable_to_neighbor) plus one row and one column -->
621621
<xs:complexType name="module_layout_type">
622622
<xs:sequence>
623-
<xs:choice minOccurs="1" maxOccurs="2">
623+
<xs:choice maxOccurs="2">
624624
<xs:element name="cable_to_parent" type="cable_to_type" />
625625
<xs:element name="cable_to_neighbor" type="cable_to_type" />
626626
</xs:choice>
@@ -724,12 +724,12 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
724724
<!-- need to add: albedo, areal picture, ground_slope, ground_azimuth, digital_elevation_model -->
725725
<xs:complexType>
726726
<xs:sequence>
727-
<xs:element name="vertex_count" type="xs:int" minOccurs="0">
727+
<xs:element name="vertex_count" type="xs:positiveInteger" minOccurs="0">
728728
<xs:annotation>
729729
<xs:documentation>Number of vertexes in the terrain surface.</xs:documentation>
730730
</xs:annotation>
731731
</xs:element>
732-
<xs:element name="triangle_count" type="xs:int" minOccurs="0">
732+
<xs:element name="triangle_count" type="xs:positiveInteger" minOccurs="0">
733733
<xs:annotation>
734734
<xs:documentation>Number of triangular faces in the terrain surface.</xs:documentation>
735735
</xs:annotation>
@@ -753,46 +753,52 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
753753
</xs:attribute>
754754
</xs:complexType>
755755
</xs:element>
756-
<xs:element name="modules">
756+
<xs:element name="components">
757757
<xs:complexType>
758-
<xs:sequence>
759-
<xs:element name="module" type="module_type_object" minOccurs="1" maxOccurs="unbounded" />
760-
</xs:sequence>
761-
</xs:complexType>
762-
</xs:element>
763-
<xs:element name="inverters">
764-
<xs:complexType>
765-
<xs:sequence>
766-
<xs:element name="inverter" type="inverter_type_object" minOccurs="1" maxOccurs="unbounded" />
767-
</xs:sequence>
768-
</xs:complexType>
769-
</xs:element>
770-
<xs:element name="combiners_dc">
771-
<xs:complexType>
772-
<xs:sequence>
773-
<xs:element name="combiner_dc" type="combiner_dc_type_object" minOccurs="0" maxOccurs="unbounded" />
774-
</xs:sequence>
775-
</xs:complexType>
776-
</xs:element>
777-
<xs:element name="combiners_ac">
778-
<xs:complexType>
779-
<xs:sequence>
780-
<xs:element name="combiner_ac" type="combiner_ac_type_object" minOccurs="0" maxOccurs="unbounded" />
781-
</xs:sequence>
782-
</xs:complexType>
783-
</xs:element>
784-
<xs:element name="cables">
785-
<xs:complexType>
786-
<xs:sequence>
787-
<xs:element name="cable" type="cable_type_object" minOccurs="0" maxOccurs="unbounded" />
788-
</xs:sequence>
789-
</xs:complexType>
790-
</xs:element>
791-
<xs:element name="transformers">
792-
<xs:complexType>
793-
<xs:sequence>
794-
<xs:element name="transformer" type="transformer_type_object" minOccurs="0" maxOccurs="unbounded" />
795-
</xs:sequence>
758+
<xs:all>
759+
<xs:element name="modules" minOccurs="0">
760+
<xs:complexType>
761+
<xs:sequence>
762+
<xs:element name="module" type="module_type_object" maxOccurs="unbounded" />
763+
</xs:sequence>
764+
</xs:complexType>
765+
</xs:element>
766+
<xs:element name="inverters" minOccurs="0">
767+
<xs:complexType>
768+
<xs:sequence>
769+
<xs:element name="inverter" type="inverter_type_object" maxOccurs="unbounded" />
770+
</xs:sequence>
771+
</xs:complexType>
772+
</xs:element>
773+
<xs:element name="combiners_dc" minOccurs="0">
774+
<xs:complexType>
775+
<xs:sequence>
776+
<xs:element name="combiner_dc" type="combiner_dc_type_object" maxOccurs="unbounded" />
777+
</xs:sequence>
778+
</xs:complexType>
779+
</xs:element>
780+
<xs:element name="combiners_ac" minOccurs="0">
781+
<xs:complexType>
782+
<xs:sequence>
783+
<xs:element name="combiner_ac" type="combiner_ac_type_object" maxOccurs="unbounded" />
784+
</xs:sequence>
785+
</xs:complexType>
786+
</xs:element>
787+
<xs:element name="cables" minOccurs="0">
788+
<xs:complexType>
789+
<xs:sequence>
790+
<xs:element name="cable" type="cable_type_object" maxOccurs="unbounded" />
791+
</xs:sequence>
792+
</xs:complexType>
793+
</xs:element>
794+
<xs:element name="transformers" minOccurs="0">
795+
<xs:complexType>
796+
<xs:sequence>
797+
<xs:element name="transformer" type="transformer_type_object" maxOccurs="unbounded" />
798+
</xs:sequence>
799+
</xs:complexType>
800+
</xs:element>
801+
</xs:all>
796802
</xs:complexType>
797803
</xs:element>
798804
<xs:element name="rack">
@@ -813,12 +819,12 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
813819
<xs:documentation>Spacing between modules in the column direction</xs:documentation>
814820
</xs:annotation>
815821
</xs:element>
816-
<xs:element name="module_rows" type="xs:int">
822+
<xs:element name="module_rows" type="xs:positiveInteger">
817823
<xs:annotation>
818824
<xs:documentation>Number of rows of modules in the rack</xs:documentation>
819825
</xs:annotation>
820826
</xs:element>
821-
<xs:element name="module_columns" type="xs:int">
827+
<xs:element name="module_columns" type="xs:positiveInteger">
822828
<xs:annotation>
823829
<xs:documentation>Number of columns of modules in the rack</xs:documentation>
824830
</xs:annotation>
@@ -911,7 +917,7 @@ xmlns:collada="http://www.collada.org/2008/03/COLLADASchema">
911917
</xs:annotation>
912918
<xs:complexType>
913919
<xs:sequence>
914-
<xs:element name="instance_rack_ref" minOccurs="1" maxOccurs="unbounded">
920+
<xs:element name="instance_rack_ref" maxOccurs="unbounded">
915921
<xs:complexType>
916922
<xs:attribute name="id" type="xs:ID">
917923
<xs:annotation>

0 commit comments

Comments
 (0)