Sorry to reopen the case already addressed here. To aggravate my case, I am not an expert in computer science.
Taking the example given by the page linked above, it seems that most of the online XML/XSD validator reject it as invalid with the message :
s4s-elt-invalid-content.1: The content of '#AnonType_IMtypeIMtimehorizonenabler' is invalid. Element 'alternative' is invalid, misplaced, or occurs too often.
Indeed it seems that the version of XSD is critical as it is underlined that the XSD code must explicitly stipulate:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" vc:minVersion="1.1">
My question is therefore the following:
- Did I missed something OR
- online validators does not support this vc:minVersion="1.1" prescription
My own XML file:
<?xml version="1.0" encoding="UTF-8"?>
<enabler>
<name>my landing gear</name>
<type> techno design</type>
<subtype>landing gear</subtype>
<timehorizon>
<year>2030</year>
<trl>5</trl>
<ttm>P24M</ttm>
<IM>
<IMname>EpndB</IMname>
<IMtype type="Metric">
<Munit>dB</Munit>
<Mvalue>4.5</Mvalue>
</IMtype>
</IM>
<IM>
<IMname>Nox</IMname>
<IMtype type="Metric">
<Munit>ppm</Munit>
<Mvalue>4.5</Mvalue>
</IMtype>
</IM>
<IM>
<IMname>QOL</IMname>
<IMtype type="Indicator">
<Idescriptor>ppm</Idescriptor>
<Ivalue>A+</Ivalue>
</IMtype>
</IM>
</timehorizon>
<timehorizon>
<year>2050</year>
<trl>7</trl>
<ttm>P12M</ttm>
</timehorizon>
</enabler>
My own XSD file
<?xml version="1.0" encoding="utf-8"?>
<pps:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:pps="http://www.w3.org/2001/XMLSchema" xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" vc:minVersion="1.1">
<pps:element name="enabler">
<pps:complexType>
<pps:sequence>
<pps:element name="name" type="pps:string" />
<pps:element name="type" type="pps:string" />
<pps:element name="subtype" type="pps:string" />
<!-- Defining properties for each time horizon -->
<pps:element name="timehorizon" minOccurs="1" maxOccurs="unbounded">
<pps:complexType>
<pps:sequence>
<pps:element name="year" type="pps:gYear"/>
<pps:element name="trl">
<pps:simpleType>
<pps:restriction base="pps:integer">
<pps:minInclusive value="1"/>
<pps:maxInclusive value="12"/>
</pps:restriction>
</pps:simpleType>
</pps:element>
<pps:element name="ttm" type="pps:duration"/>
<!-- Defining Indicator or metric for each time horizon -->
<pps:element name="IM" minOccurs="0" maxOccurs="unbounded">
<pps:complexType>
<pps:sequence>
<pps:element name="IMname" type="pps:string"/>
<pps:element name="IMtype" maxOccurs="unbounded">
<pps:complexType>
<pps:alternative test="@type = Metric" type="MetricType"/>
<pps:alternative test="@type = Indicator" type="IndicatorType"/>
</pps:complexType>
</pps:element>
</pps:sequence>
</pps:complexType>
</pps:element>
<pps:complexType name="MetricType">
<pps:sequence>
<pps:element name="Munit" type="pps:string"/>
<pps:element name="Mvalue" type="pps:decimal"/>
</pps:sequence>
</pps:complexType>
<pps:complexType name="IndicatorType">
<pps:sequence>
<pps:element name="Idescriptor" type="pps:string"/>
<pps:element name="Ivalue" type="pps:string"/>
</pps:sequence>
</pps:complexType>
</pps:sequence>
</pps:complexType>
</pps:element>
</pps:sequence>
</pps:complexType>
</pps:element>
</pps:schema>