Skip to Content
0
Jan 29, 2020 at 11:16 AM

SAP CPI XSD validation error

487 Views

Hello community,

I've tried to import the following XSD.

cxml1-1-po-orginal.txt

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" />
  <xs:element name="cXML">
    <xs:complexType>
      <xs:sequence>
        <!-- removed content due to text length -->
        <xs:element name="Request">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="OrderRequest">
                <xs:complexType>
                  <xs:sequence>
                    <!-- removed content due to text length -->
                    <xs:element maxOccurs="unbounded" name="ItemOut">
                      <xs:complexType>
                        <xs:sequence>
                            <!-- removed content due to text length -->
                            <xs:element name="ItemDetail">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="UnitPrice">
                                  <xs:complexType>
                                    <xs:sequence>
                                      <xs:element name="Money">
                                        <xs:complexType>
                                          <xs:simpleContent>
                                            <xs:extension base="xs:string">
                                              <xs:attribute name="currency" type="xs:string" use="required" />
                                            </xs:extension>
                                          </xs:simpleContent>
                                        </xs:complexType>
                                      </xs:element>
                                    </xs:sequence>
                                  </xs:complexType>
                                </xs:element>
                                <xs:element name="Description">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute ref="xml:lang" use="required" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                                <!-- removed content due to text length -->
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <!-- removed content due to text length -->
                          </xs:sequence>
                        <xs:attribute name="quantity" type="xs:unsignedByte" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="deploymentMode" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="payloadID" type="xs:string" use="required" />
      <xs:attribute name="timestamp" type="xs:dateTime" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>

The import failed due to the following error:

According to this question answered by Morten Wittrock. I shall download the XSD and upload it to the resources and edit the schemaLocation attribute. The result is:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xml="http://www.w3.org/XML/1998/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
	<!-- ... -->
</xs:schema>


I've uploaded the file to the resources:

If I try to create a message mapping and select the cXML1-1_PO_edited XSD the same error is presented.

What am I missing here?

Regards

FCD