Unable to parse any XML input. Error on line 1: The markup in the document preceding the root element must be well-forme
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 1
- Joined: Fri Oct 04, 2019 4:44 am
Unable to parse any XML input. Error on line 1: The markup in the document preceding the root element must be well-forme
Post by cameron arnott »
I am creating an XML in .net using XmlTextWriter to attach as a file in Dynamics.
When I try to test the file I get the error - Unable to parse any XML input. Error on line 1: The markup in the document preceding the root element must be well-formed.
If I open the file in notepad++ and copy and paste the contents into a new text file and save as a new XML file, the new XML file does not return the error.
Thanks.
When I try to test the file I get the error - Unable to parse any XML input. Error on line 1: The markup in the document preceding the root element must be well-formed.
If I open the file in notepad++ and copy and paste the contents into a new text file and save as a new XML file, the new XML file does not return the error.
Thanks.
-
- Posts: 9451
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Unable to parse any XML input. Error on line 1: The markup in the document preceding the root element must be well-f
Hi,
This forum is mostly for Oxygen XML Editor related problems and not for generic XML questions.
If I were to guess, possibly the original XML document has some kind of byte-order-mark (BOM) bytes in front of the file content. This does not necessarily mean the XML is not wellformed, just that maybe the XmlTextWriter is not 100% compliant with the XML standard.
If you download Oxygen XML Editor and try to open the XML document, does it report any error after the XML is opened? If not, in the Oxygen Preferences->"Encoding" page you can switch the "UTF-8 BOM handling" to "Don't Write", make a small change in the XML and save. Oxygen should remove the BOM bytes from before the XML content.
Regards,
Radu
This forum is mostly for Oxygen XML Editor related problems and not for generic XML questions.
If I were to guess, possibly the original XML document has some kind of byte-order-mark (BOM) bytes in front of the file content. This does not necessarily mean the XML is not wellformed, just that maybe the XmlTextWriter is not 100% compliant with the XML standard.
If you download Oxygen XML Editor and try to open the XML document, does it report any error after the XML is opened? If not, in the Oxygen Preferences->"Encoding" page you can switch the "UTF-8 BOM handling" to "Don't Write", make a small change in the XML and save. Oxygen should remove the BOM bytes from before the XML content.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service