Home Page › Forums › BizTalk 2004 – BizTalk 2010 › XML Validate Instance error
- This topic has 0 replies, 1 voice, and was last updated 8 years, 3 months ago by
community-content.
-
AuthorPosts
-
-
December 3, 2008 at 5:54 AM #21296
Hi,
I am generating an xml through a .Net application. This uses xmlwriter object to generate the xml file. Now I need to consume this message in my orch. The problem i face is if i validate the schema keeping the .Net generated file as input instance i run into erros.Do i need to take care anything while creating xml through .Net.
Sample .net code I have used :
XmlTextWriter xmlWrVendor = new XmlTextWriter(strXmlDest, Encoding.UTF8);
xmlWrVendor.WriteStartDocument();
xmlWrVendor.WriteStartElement(
“ns0”,“Invoices”,“http://InvoiceIntegration.Invoices”
);
xmlWrVendor.WriteStartElement(
“Invoice”
);
xmlWrVendor.WriteElementString(dsEmployeeData.Tables[0].Columns[0].ColumnName.Replace(
” “, “”
), dsEmployeeData.Tables[0].Rows[intCounter].ItemArray[0].ToString());
My Schema :
<?xml version=”1.0″ encoding=”utf-16″ ?>– <xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003“ xmlns=”http://InvoiceIntegration.InvTrans“ targetNamespace=”http://InvoiceIntegration.InvTrans“ xmlns:xs=”http://www.w3.org/2001/XMLSchema“><xs:element name=”Type“ type=”xs:string“ /><xs:element name=”Vendor“ type=”xs:string“ /><xs:element name=”VendorNo“ type=”xs:string“ /><xs:element name=”Site“ type=”xs:string“ /><xs:element name=”InvDT“ type=”xs:string“ /><xs:element name=”GLDT“ type=”xs:string“ /><xs:element name=”VoucherNo“ type=”xs:string“ /><xs:element name=”InvNo“ type=”xs:string“ /><xs:element name=”InvAmt“ type=”xs:string“ /><xs:element name=”Curr“ type=”xs:string“ /><xs:element name=”Narration“ type=”xs:string“ /><xs:element name=”PaymentCurr“ type=”xs:string“ /><xs:element name=”PaymentRtDT“ type=”xs:string“ /><xs:element name=”Project“ type=”xs:string“ /><xs:element name=”Task“ type=”xs:string“ /><xs:element name=”ExpenditureType“ type=”xs:string“ /><xs:element name=”ExpenditureOrg“ type=”xs:string“ /><xs:element name=”EmpNumber“ type=”xs:string“ /><xs:element name=”ExpenditureDT“ type=”xs:string“ /><xs:element name=”PRNumber“ type=”xs:string“ /><xs:element name=”TDS“ type=”xs:string“ /><xs:element name=”WCT“ type=”xs:string“ /><xs:element name=”Amount“ type=”xs:string“ /><xs:element name=”Description“ type=”xs:string“ /><xs:element name=”TaxCode“ type=”xs:string“ /><xs:element name=”GLDate“ type=”xs:string“ /><xs:element name=”ExpItemDt“ type=”xs:string“ /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema>Regards
VJ
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.