Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Create XML document nodes

$
0
0

Hi all,

I am trying to create an XML document that looks like this:

<CustomerData><ReferenceInformation><ReturnRef>TESTREF0123</ReturnRef><Action>New</Action></ReferenceInformation><HoldingEntity>TEST12345</HoldingEntity><Profitable>1</Profitable><LocalData><CustomerInfo><CustRef>TEST ACCOUNTReg</CustRef><CustAction>New</CustAction></CustomerInfo><CustomerNumber>99110022</CustomerNumber><OrderData><PurchaseOrder>20</PurchaseOrder><OrderAmount currCode="GBP">1203.00</OrderAmount></OrderData><Contact><FirstName>FirstName</FirstName><LastName>Surname</LastName><Address><StreetName>Street 123</StreetName><City>My City</City><CountryCode>GB</CountryCode></Address></Contact></LocalData></CustomerData>

I need to create multiple items for LocalData. At the moment I am able to do it for one LocalData node using the code below (note I have stripped out a lot in order to send it but I can provide more info.

        private void localData(Customer Info)
        {
            object[] customerItems = new object[] { customerInfo };
            customerItems.Items = accountItems;

            ItemsChoiceType[] accountFieldNames = new ItemsChoiceType[] { correspondingFields };
            customerItems.ItemsElementName = accountFieldNames;
        }

I got a schema done for me and created a class file using xsd.exe which is where I am getting the arrays from.

How best can I achieve what I am looking to do?


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>