Better xsd.exe

now, it supports property, collection, import and option not to generate codes for imported types. download.

for more info, check here.

Statement.xsd

<br /> <?xml version="1.0" encoding="utf-8" ?><br /> <xs:schema xmlns:tns="http://microsoft.com/practices/ConsolidatedAccountStatementResponse" elementFormDefault="qualified" targetNamespace=http://microsoft.com/practices/ConsolidatedAccountStatementResponse xmlns:xs="http://www.w3.org/2001/XMLSchema"><br /> <xs:annotation><br /> <xs:appinfo><br /> <code xmlns="http://weblogs.asp.net/cazzu" skipImportedType="true"><br /> <extension Type="XsdGenerator.Extensions.ArraysToCollectionsExtension, XsdGenerator.Library" /><br /> <extension Type="XsdGenerator.Extensions.FieldsToPropertiesExtension, XsdGenerator.Library" /><br /> </code><br /> </xs:appinfo><br /> </xs:annotation><br /> <xs:import namespace="http://microsoft.com/practices/CashAccount" schemaLocation="CashAccount.xsd" /><br /> <xs:element name="ConsolidatedAccountStatementResponse" type="tns:ConsolidatedAccountStatementResponse" /><br /> <xs:complexType name="ConsolidatedAccountStatementResponse"><br /> <xs:sequence><br /> <xs:element name="CashAccounts" xmlns="http://microsoft.com/practices/CashAccount" type="ArrayOfCashAccount" /><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:schema><br />
CashAccount.xsd
<br /> <?xml version="1.0" encoding="utf-8" ?><br /> <xs:schema xmlns:tns="http://microsoft.com/practices/CashAccount" elementFormDefault="qualified" targetNamespace="http://microsoft.com/practices/CashAccount" xmlns:xs="http://www.w3.org/2001/XMLSchema"><br /> <xs:annotation><br /> <xs:appinfo><br /> <code xmlns="http://weblogs.asp.net/cazzu" skipImportedType="true"><br /> <extension Type="XsdGenerator.Extensions.ArraysToCollectionsExtension, XsdGenerator.Library" /><br /> <extension Type="XsdGenerator.Extensions.FieldsToPropertiesExtension, XsdGenerator.Library" /><br /> </code><br /> </xs:appinfo><br /> </xs:annotation><br /> <xs:complexType name="CashAccount"><br /> <xs:sequence><br /> <xs:element minOccurs="0" maxOccurs="1" name="AccountNumber" type="xs:string" /><br /> <xs:element minOccurs="1" maxOccurs="1" name="Contract" type="xs:int" /><br /> <xs:element minOccurs="1" maxOccurs="1" name="Balance" type="xs:decimal" /><br /> <xs:element minOccurs="0" maxOccurs="1" name="AccountType" type="xs:string" /><br /> </xs:sequence><br /> </xs:complexType><br /> <xs:complexType name="ArrayOfCashAccount"><br /> <xs:sequence><br /> <xs:element minOccurs="0" maxOccurs="unbounded" ref="tns:CashAccount" /><br /> </xs:sequence><br /> </xs:complexType><br /> <xs:element name="CashAccount" type="tns:CashAccount" /><br /> </xs:schema><br />
‘ Statement.vb

_
Public Class ConsolidatedAccountStatementResponse

Private _cashAccounts As CashAccountCollection


_
Public Property CashAccounts As CashAccountCollection
Get
Return Me._cashAccounts
End Get
Set
Me._cashAccounts = value
End Set
End Property
End Class
Public Class CashAccountCollection
Inherits System.Collections.CollectionBase

Public Default Property Item(ByVal idx As Integer) As CashAccount
Get
Return CType(MyBase.InnerList(idx),CashAccount)
End Get
Set
MyBase.InnerList(idx) = value
End Set
End Property

Public Function Add(ByVal value As CashAccount) As Integer
Return MyBase.InnerList.Add(value)
End Function
End Class