Wednesday, March 7, 2012

Problem with XML Source

Hello everyone we are having a problem I presume many of you have already dealt with.
We are using the XML source dataflow component, to parse xml-documents exported by an external system.

The problem that arise is when som values from the from the external system i "Null" that element is excluded from the XML file.

Ex.

Note: In the case below the second post has phone==NULL in database and we get the following XML.

<indata>
<post>
<name>TheName1</name>
<phone>123456789</phone>
</post>
<post>

<name>TheName2</name>
</post>

</indata>

This cause the XML source to throw an "Error Disposition" - Error.

Is there a solution to this problem?

You need to modify the XSD Schema to allow <phone> to be an optional element.

<xs:element minOccurs="0" name="phone" type="xs:string" />

No comments:

Post a Comment