Current Process
I have a valid XSD from Agresso website, which I have successfully converted into class, using xsd.exe
I can define all the objects I need, e.g.
ABWInvoice oInvoiceAgresso = new ABWInvoice() { };
List<ABWInvoiceInvoice> invoiceslist = new List<ABWInvoiceInvoice>();
List<ABWInvoiceInvoiceDetail> invoicesDetailsList = new List<ABWInvoiceInvoiceDetail>();
and then to populate with the data
_parent.invoiceslist.Add(new ABWInvoiceInvoice
{
InvoiceNo = _parent.InvoicesResultSet.Numeric1,
Header = new ABWInvoiceInvoiceHeader
{
InvoiceDate = _parent.InvoiceHeaders.InvoiceDate,
DueDate = _parent.vDueDate.Value,
OrderRef = _parent.InvoicesResultSet.GenericId,
Currency = _parent.Currency.Actual_Currency.TrimEnd(),
Seller = new ABWInvoiceInvoiceHeaderSeller { SellerNo = 1000 }
},
Details = _parent.invoicesDetailsList.ToArray(),
Summary = _parent.invoiceSummary
});
I will spare the rest of the code... Eventually I get a valid XML file, which includes the following Date related elements, which come from agrlib namespace of the above XSD:
<InvoiceDate>2018-02-01</InvoiceDate>
<DueDate>2018-02-01</DueDate>
The Issue
Now a customer came back, saying they want to keep the reference to the agrlib, i.e. they want to have the following:
<agrlib:InvoiceDate>2018-02-01</InvoiceDate>
<agrlib:DueDate>2018-02-01</DueDate>
I've checked, using w3schools XML validator and it seems their request is absolutely valid, yet it might also mean they use their own parsing tool.
Question
How can I achieve their request in C#, please?