Friday, 22 April 2016

Property for allowing multiple records in XSD

maxOccurs="unbounded" minOccurs="0"

The above property of maxOccurs should be used  in order to allow multiple records in XSD.

Sample XML consisting of multiple records.
<?xml version="1.0" encoding="UTF-8"?>
<DIUM_MESSAGE>
<FAILED_ID>
<INTERFACE>DEGREE</INTERFACE>
<ID>789456123</ID>
<OBJECT_TYPE>AU</OBJECT_TYPE>
<REASON>CCCCCCCCCCCCCCCCCCCCC</REASON>
</FAILED_ID>
<FAILED_ID>
<INTERFACE>INTER</INTERFACE>
<ID>4545454545454</ID>
<OBJECT_TYPE>FK</OBJECT_TYPE>
<REASON>DDDDDDDDDDDDDDDDDDDDDDDDDDD</REASON>
</FAILED_ID>
</DIUM_MESSAGE>

Sample XSD for multiple records.

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="DIUM_MESSAGE">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="FAILED_ID" maxOccurs="unbounded" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="INTERFACE"/>
              <xs:element type="xs:long" name="ID"/>
              <xs:element type="xs:string" name="OBJECT_TYPE"/>
              <xs:element type="xs:string" name="REASON"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

get it

 http://hinekv1.ddns.net:8008/get.php?username=Varga_Florentina1tv&password=j5MgWBs18t&type=m3u_plus&output=mpegts http://www.lo...