Skip to Content
0
Former Member
Jan 03, 2012 at 08:53 AM

Mapping multiplicity

18 Views

Gurus salutem,

I think I have a seemingly simple question.

I would like to map a structure with mutiplicity 1 to a structure with multiplicity 3.

The non-repetitive structure looks like as follows:

<xsd:complexType name="inParameters">

<xsd:sequence>

<xsd:element maxOccurs="1" minOccurs="0" name="key1" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key1Value" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key2" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key2Value" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="ownerID" type="xsd:string"/>

</xsd:sequence>

The repetitive segment looks like follows:

<xsd:complexType name="QueryFilter">

<xsd:sequence>

<xsd:element maxOccurs="1" minOccurs="0" name="operation" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="action" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="attribute" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="valueLow" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="valueHigh" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="condition" type="cafpref3:condition"/>

</xsd:sequence>

The result of the mapping should be:

QueryFilter(1).attribute := inParameters.key1

QueryFilter(1).value := inParameters.key1Value

QueryFilter(1).condition := u201CEQu201D

QueryFilter(2).attribute := inParameters.key2

QueryFilter(2).value := inParameters.key2Value

QueryFilter(2).condition := u201CEQu201D

QueryFilter(3).attribute := u201CownerIDu201D

QueryFilter(3).value := inParameters.ownerID

QueryFilter(4).condition := u201CEQu201D

In short the three repetitive segments contain the values from the non-repetitive segment.

Probably more than one guru has encountered this issue.

Thanks for your replies,

Martijn.