Hi guys
I am trying to create a SAFT file
http://www.oecd.org/ctp/taxadministr...quirements.htm
I have the following class
when i serialize the object i get
as you can see i get <CompanyAddress> element repeated...
The result i want to produce is something like this:
with only one element created for each item (CompanyAddress)
Any help ?
I am trying to create a SAFT file
http://www.oecd.org/ctp/taxadministr...quirements.htm
I have the following class
Code:
Imports System.ComponentModel
<TypeConverter(GetType(ExpandableObjectConverter))> _
Public Class Header
Private _companyAddress As List(Of CompanyAddress)
Public Property AuditFileVersion As String
Public Property CompanyID As String
Public Property TaxRegistrationNumber As String
Public Property CompanyAddress() As List(Of CompanyAddress)
Get
Return _companyAddress
End Get
Set(ByVal value As List(Of CompanyAddress))
_companyAddress = value
End Set
End Property
Public Sub New()
_companyAddress = New List(Of CompanyAddress)
End Sub
End Class
Public Class CompanyAddress
Public Property AddressDetail As String
Public Property City As String
Public Property PostalCode As String
Public Property Country As String
End Class
Code:
<Header>
<AuditFileVersion>1.1.0</AuditFileVersion>
<CompanyAddress>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
</CompanyAddress>
</Header>
The result i want to produce is something like this:
Code:
<Header>
<AuditFileVersion>1.1.0</AuditFileVersion>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
<CompanyAddress>
<City>Porto</City>
<PostalCode>4100</PostalCode>
</CompanyAddress>
</Header>
Any help ?