The following article describes how you can use classes in the
System.XML.Schema namespace of the Microsoft .NET Framework to build a tool
that generates sample XML documents that conform to a given schema:
http://msdn.microsoft.com/library/en-us/dnxmlnet/html/xmlgen.asp --
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm "Ganesh Muthuvelu" <GaneshMuthuvelu@discussions.microsoft.com> wrote in
message news:C378296C-D0E5-4F7A-B217-E39CAB4004FB@microsoft.com...
[quoted text, click to view] > Hello,
> Let us say that I have a schema or complex type like this one below:
>
> Is there a way programtically or a tool to create sample XML file/data for
> the schema?. I have number of such complex tpyer/schemas for which I need
> to
> create sample XMLs so I thought of doing it programatically.. Any pointers
> would be appreciated.
>
> Thanks.
>
> **********************
> <xs:complexType name="AddRequest">
> <xs:annotation>
> <xs:documentation>
> Add a group.
> The response is either a SuccessResponse or an ErrorResponse.
> </xs:documentation>
> </xs:annotation>
> <xs:complexContent>
> <xs:extension base="Request">
> <xs:sequence>
> <xs:element name="serviceProviderId" type="xs:string"/>
> <xs:element name="groupId" type="xs:string"/>
> <xs:element name="defaultDomain" type="xs:string"/>
> <xs:element name="userLimit" type="xs:string"/>
> <xs:element name="groupName" type="xs:string" minOccurs="0"/>
> <xs:element name="callingLineIdName" type="xs:string"
> minOccurs="0"/>
> <xs:element name="timeZone" type="xs:string" minOccurs="0"/>
> <xs:element name="locationDialingCode" type="xs:string"
> minOccurs="0"/>
> <xs:element name="contact" type="xs:string" minOccurs="0"/>
> <xs:element name="address" type="xs:string" minOccurs="0"/>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
> **********************
>