|
Home > Archive > BizTalk Server General > June 2006 > Problem in mapping - Avoid the empty element
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem in mapping - Avoid the empty element
|
|
| Murugan 2006-06-28, 1:21 pm |
| Hi all,
I have a problem to generate the destination schema without empty element. I
explained my problem with source and destination data.
inbound schema :
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://emptySample.Schema1"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://emptySample.Schema1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Emp">
<xs:complexType>
<xs:attribute name="FirstName" type="xs:string" />
<xs:attribute name="LastName" type="xs:string" />
<xs:attribute name="MiddleName" type="xs:string" />
<xs:attribute name="Address1" type="xs:string" />
<xs:attribute name="Address2" type="xs:string" />
<xs:attribute name="City" type="xs:string" />
<xs:attribute name="State" type="xs:string" />
<xs:attribute name="Zip" type="xs:string" />
<xs:attribute name="DOB" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:schema>
Outbound schema:
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://emptySample.Schema2"
xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://emptySample.Schema2"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="Name">
<xs:complexType>
<xs:attribute name="First" type="xs:string" />
<xs:attribute name="Last" type="xs:string" />
<xs:attribute name="Middle" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Address">
<xs:complexType>
<xs:attribute name="Line1" type="xs:string" />
<xs:attribute name="Line2" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Geography">
<xs:complexType>
<xs:attribute name="City" type="xs:string" />
<xs:attribute name="State" type="xs:string" />
<xs:attribute name="Zip" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Personal">
<xs:complexType>
<xs:attribute name="DOB" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Inbound Data:
<ns0:Emp
FirstName="FirstName_0"
LastName="LastName_1"
MiddleName="MiddleName_2"
Address1="Address1_3"
Address2="Address2_4"
City="City_5"
State="State_6"
Zip="Zip_7"
xmlns:ns0="http://emptySample.Schema1" />
After Mapping using logical existance and value map functionoids
Outbound data:
<?xml version="1.0" encoding="utf-8"?>
<ns0:Employee xmlns:ns0="http://emptySample.Schema2">
<Name First="FirstName_0" Last="LastName_1" Middle="MiddleName_2"></Name>
<Address Line1="Address1_3" Line2="Address2_4"></Address>
<Geography City="City_5" State="State_6" Zip="Zip_7"></Geography>
<Personal></Personal>
</ns0:Employee>
In outbound data i have empty element. how to avoid this empty element
("<Personal></Personal> ") .
If anybody know the solution please share with me,
Thanks in advance
Murugan A
| |
| Yakov72 2006-06-28, 7:17 pm |
| Did you try set "Nillable" to "True" in destination schema?
| |
| Murugan 2006-06-29, 1:17 pm |
| Hi Yakov,
Thanks for immediate reply
I got the correct data (ie) without empty element for using logical
existance functionds.
Thanks
Murugan A
"Yakov72" wrote:
> Did you try set "Nillable" to "True" in destination schema?
>
>
|
|
|
|
|