cancel
Showing results for 
Search instead for 
Did you mean: 

XSD elements problem

Former Member
0 Kudos

Hi Guru's,

I am working with SAP PI 7.0 and when I upload an XSD to PI I can see the following structure:

<xs:element name="fields">

<xs:complexType>

<xs:attribute name="Field1" type="xs:string" use="required"/>

<xs:attribute name="Field2" type="xs:string" use="required"/>

<xs:attribute name="Field3" type="xs:string"/>

</xs:complexType>

</xs:element>

When I look in the message mapping in the repository I see that field 2 and field 3 has changed position, so in message mapping it's via the following sequence:

<xs:attribute name="Field1" type="xs:string" use="required"/>

<xs:attribute name="Field3" type="xs:string"/>

<xs:attribute name="Field2" type="xs:string" use="required"/>

How can this be?

Best regards,

Guido Koopmann

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

I discussed this with a developer from SAP some times ago.

When the XSD does not have a "sequence" tag, PI picks up the elements and attributes randomly.

In principle an XML parser should not make a difference, in which order the attributes come.

To avoid this behaviour, you have to add a sequence node:

<xsd:complexType>
               <xsd:sequence>
                  <xs:attribute name="Field1" type="xs:string" use="required"/>
                  <xs:attribute name="Field2" type="xs:string" use="required"/>
                  <xs:attribute name="Field3" type="xs:string"/>
               </xsd:sequence>
            </xsd:complexType>

Answers (0)