Error - cvc-complex-type.2.4.a from liquid generated XSD
Problem reported by Aggelos Kellezis - 1/12/2021 at 12:59 PM
Resolved
Hello there,

i got a liquid generated XSD (Created with Liquid XML Studio Developer Edition (Trial) 8.1.7.2743)
and i converted it to XML (iquid-technologies.com/online-xsd-to-xml-converter)
then i validated the XML with the XSD with this tool: liquid-technologies.com/online-xsd-validator

and i am getting an error "cvc-complex-type.2.4.a: Invalid content was found starting with element"
any idea why the converter does not work with the liquid generate XSD? thanks

3 Replies

Reply to Thread
0
Liquid Support Replied
Employee Post
Hi,

Sometimes a generated XML document may need data manipulating to be valid, e.g. values validating against a regular expression may be invalid.

Can you please post a copy of the XSD and XML document?

0
Aggelos Kellezis Replied
Hello! sure here it is

XSD:
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio Developer Edition (Trial) 8.1.7.2743 (liquid-technologies.com)-->
<xs:schema xmlns="yeka.gr/ape" xml:lang="gr" attributeFormDefault="unqualified" targetNamespace="yeka.gr/ape" xmlns:xs="w3.org/2001/XMLSchema">
  
  <xs:complexType name="DetailType">
    <xs:sequence>
      <xs:element name="id" nillable="false">
        <xs:annotation>
          <xs:documentation>ID</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="([0-9]){9}" />
            <xs:length value="9" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="surname" nillable="false">
        <xs:annotation>
          <xs:documentation>Surname</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="230" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="name" nillable="false">
        <xs:annotation>
          <xs:documentation>Name</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="50" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="StoreDetailType">
    <xs:sequence>
      <xs:element name="EkthesiDetails" type="DetailType"  minOccurs="1"  maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>EPA</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="EpaType">
    <xs:sequence>
      <xs:element name="ID" nillable="false">
        <xs:annotation>
          <xs:documentation>ID</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:pattern value="([0-9]){9}" />
            <xs:length value="9" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>
      <xs:element name="desc">
        <xs:annotation>
          <xs:documentation>DESC</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
          <xs:restriction base="xs:string">
            <xs:maxLength value="50" />
          </xs:restriction>
        </xs:simpleType>
      </xs:element>

      <xs:element name="Details" type="StoreDetailType">
        <xs:annotation>
          <xs:documentation>DETAILS</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="StoreEpaType">
    <xs:sequence>
      <xs:element name="Ekthesi" type="EpaType"  minOccurs="1"  maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>Ekthesi</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:element name="EkthesisEpa" type="StoreEpaType">
    <xs:annotation>
      <xs:documentation>EkthesisEpa</xs:documentation>
    </xs:annotation>
  </xs:element>
</xs:schema>
XLS:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (liquid-technologies.com) -->
<EkthesisEpa xmlns="yeka.gr/ape" xsi:schemaLocation="yeka.gr/ape schema.xsd" xmlns:xsi="w3.org/2001/XMLSchema-instance">
  <Ekthesi>
    <ID>743671954</ID>
    <desc>string</desc>
    <Details>
      <EkthesiDetails>
        <id>328061433</id>
        <surname>string</surname>
        <name>string</name>
      </EkthesiDetails>
    </Details>
  </Ekthesi>
  <Ekthesi>
    <ID>768226110</ID>
    <desc>string</desc>
    <Details>
      <EkthesiDetails>
        <id>304734124</id>
        <surname>string</surname>
        <name>string</name>
      </EkthesiDetails>
    </Details>
  </Ekthesi>
  <Ekthesi>
    <ID>775719486</ID>
    <desc>string</desc>
    <Details>
      <EkthesiDetails>
        <id>409882625</id>
        <surname>string</surname>
        <name>string</name>
      </EkthesiDetails>
    </Details>
  </Ekthesi>
</EkthesisEpa>
 
0
Liquid Support Replied
Employee Post Marked As Resolution
Hi,

It looks like the online tool doesn't handle namespaces. I'll look into this as I'm not sure if it an intentional limitation or not.

If you use Liquid Studio 2020 XML Sample Generator, it correctly create a sample such as:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Studio 2020 (https://www.liquid-technologies.com) -->
<ns:EkthesisEpa xmlns:ns="yeka.gr/ape" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="yeka.gr/ape C:\Temp\EkthesisEpa.xsd">
    <Ekthesi>
        <ID>220484779</ID>
        <desc>string</desc>
        <Details>
            <EkthesiDetails>
                <id>694249386</id>
                <surname>string</surname>
                <name>string</name>
            </EkthesiDetails>
        </Details>
    </Ekthesi>
    <Ekthesi>
        <ID>121977178</ID>
        <desc>string</desc>
        <Details>
            <EkthesiDetails>
                <id>135248215</id>
                <surname>string</surname>
                <name>string</name>
            </EkthesiDetails>
        </Details>
    </Ekthesi>
    <Ekthesi>
        <ID>113514494</ID>
        <desc>string</desc>
        <Details>
            <EkthesiDetails>
                <id>721581388</id>
                <surname>string</surname>
                <name>string</name>
            </EkthesiDetails>
        </Details>
    </Ekthesi>
    <Ekthesi>
        <ID>243396442</ID>
        <desc>string</desc>
        <Details>
            <EkthesiDetails>
                <id>496739614</id>
                <surname>string</surname>
                <name>string</name>
            </EkthesiDetails>
        </Details>
    </Ekthesi>
    <Ekthesi>
        <ID>608550025</ID>
        <desc>string</desc>
        <Details>
            <EkthesiDetails>
                <id>187683588</id>
                <surname>string</surname>
                <name>string</name>
            </EkthesiDetails>
        </Details>
    </Ekthesi>
</ns:EkthesisEpa>

Reply to Thread