How do I put several repetitions of the elements that are part of a sequence that is within a complex type?
I have the following scheme:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Measurements">
<xs:annotation>
<xs:documentation>Schema for Measurements data transmission</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="m_doc" type="xs:string"/>
<xs:element name="m_parameters">
<xs:complexType>
<xs:sequence>
<xs:element name="m_name" type="xs:string"/>
<xs:element name="m_isEngValue" type="xs:boolean"/>
<xs:element name="m_unit" type="xs:string"/>
<xs:element name="m_radix" type="xs:string"/>
<xs:element name="m_value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
And I try with the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<Measurements xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<m_doc>TestDoc</m_doc>
<m_parameters>
<!-- Primer grupo -->
<m_name>Length</m_name>
<m_isEngValue>false</m_isEngValue>
<m_unit></m_unit>
<m_radix>HEXADECIMAL</m_radix>
<m_value>0</m_value>
<!-- Segundo grupo -->
<m_name>Height</m_name>
<m_isEngValue>false</m_isEngValue>
<m_unit></m_unit>
<m_radix>DECIMAL</m_radix>
<m_value>0</m_value>
</m_parameters>
</Measurements>
Getting the error:
Cvc-complex-type.2.4.d: Invalid Content Was Found Starting With Element 'm_name' No Child Element Is Expected At This Point., Line '13', Column '15'.
This error corresponds to the second group 5 elements that constitute a parameter. If I remove that second group then I have no error.
I'm testing with an online validator: www.freeformatter.com
The scheme is a requirement over which I have no control and I am obliged to respect. I have to make XML that fits that scheme.