ListObject -> XML question

R

Raghu

I need to produce an xml like the following
<customer_list_data>
<customers>
<customer>
<customer_name detail="Customer_1"/>
<customer_status detail="active"/>
</customer>
<customer>
<customer_name detail="Customer_22"/>
<customer_status detail="inactive"/>
</customer>
</customers>
</customer_list_data>

(Notice one extra parent "customer_list_data" above.)

for which the xsd is:

<xsd:schema targetNameSpace="customerbase"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="customerbase">
<xsd:element name="customers_list_data">
<xsd:complexType>
<xsd:all>
<xsd:element name="customers">
<xsd:complexType>
<xsd:all>
<xsd:element name="customer">
<xsd:complexType>
<xsd:all>
<xsd:element
name="customer_name" minOccurs="1" maxOccurs="1">

<xsd:complexType>

<xsd:attribute name="detail" type="xsd:string" use="required"/>

</xsd:complexType>
</xsd:element>
<xsd:element
name="customer_status" minOccurs="1" maxOccurs="1">

<xsd:complexType>

<xsd:attribute name="detail" type="xsd:string" use="required"/>

</xsd:complexType>
</xsd:element>

I need a list object in excel that would take user input for a list of:
customer_name, customer_status values.
Note that these correspond to the "detail" attributes of the above xsd, and
not to the xml text elements.

Now I want to produce an XmlDocument that matches the above xsd, based on
the data filled by the user in the list object.

What is the best way to do that in [ C#, VSTO 2005 SE, Excel 2003 ] ?

Note: Ideally I want to use data binding using this xsd and want an
XmlDocument to be ready already when the user clicks a button in the excel
sheet. I do Not want to use strongly typed datasets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top