XML-import with for instance with relation to other entity

1
hi, I'm having trouble importing xml data for lets say an employee and company in such a way, that an association between both (many-to-one) is established. Can this be done by including the association in the xsd and all required data in the xml?
asked
2 answers
1

Something kind of like this

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="Client">
    <xs:sequence>
        <xs:element name="ClientID" type="xs:integer"/>
    </xs:sequence>
</xs:complexType>

<xs:complexType name="Process">
    <xs:sequence>
        <xs:element name="Name" type="xs:string"/>
        <xs:element name="Active" type="xs:boolean"/>
        <xs:element name="Process_Client" minOccurs="0" maxOccurs="1">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="Client" type="Client" maxOccurs="unbounded" minOccurs="1"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:sequence>
</xs:complexType>

<xs:element name="Process" type="Process"/></xs:schema>

The key is when you set maxOccurs and minOccurs. This defines the multiplicity of the relationship. Here I am defining the association from Process to Client as many-to-one (many Clients for one Process).

answered
0

Did you read the documentation about mapping?

Regards,

Ronald

answered