I want to create a xml file using C# and I have some problem ,my method thus ;
xmlDocument.WriteStartElement("SALES_INVOICES");
xmldocument.WriteEndElement();
the Result is SALES_INVOICES>
SALES_INVOICES>
I Want to result is for WriteStartElement SALES_INVOICES> and WriteEndElement for INVOICES>
Thanks in advance .
VulpesPosted May 16, 2014, 12:13 PM
However, if you try to load this file into an XmlDocument:
you'll get the following exception:
Unhandled Exception: System.Xml.XmlException: The 'SALES_INVOICES' start tag on
line 2 position 2 does not match the end tag of 'INVOICES'. Line 4, position 3.
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
Demir AcarPosted May 16, 2014, 11:57 AM
VulpesPosted May 16, 2014, 11:51 AM
The tags must match otherwise the XML document would be malformed.
Demir AcarPosted May 16, 2014, 11:05 AM
VulpesPosted May 16, 2014, 10:49 AM
then the output should now be:
Demir AcarPosted May 16, 2014, 10:14 AM
And Result is
I want to modify last endelement TAG
SO ; WriteStartElement is
and Wanna be Last writeendelement is
VulpesPosted May 16, 2014, 10:02 AM
When I ran that code just now I obtained:
which is what I expected.
Can you clarify what you it is you're getting and what you want it to be.