I have a piece of xml that looks something like
<SubscriptionProduct>
<SubscriptionProductIdentifier>
<SubscriptionProductIdentifierType>
<SubscriptionProductIDType>01</SubscriptionProductIDType>
<ID>123456</ID>
<Value>AAAA</Value>
</SubscriptionProductIdentifierType>
<SubscriptionProductIdentifierType xsi:nil="true" />
</SubscriptionProductIdentifier>
<SubscriptionProductDescription />
</SubscriptionProduct>
As you can see the SubscriptionProductIdentifierType is a collection and in this case only contains one item.
How do I ignore the second empty item?
I've tried adding the xml ignore, however it removes the entire collection and I only want the second item in the collection removed if there is no data.
[System.Xml.Serialization.XmlIgnoreAttribute()]
public SubscriptionProductIdentifierType[] SubscriptionProductIdentifier {
get {
return this.subscriptionProductIdentifierField;
}
set {
this.subscriptionProductIdentifierField = value;
}
}
Any help would be very much appreciated.
Kind Regards Zal