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

XML Parsing Error: not well-formed (C# Visual Studio 2013)

$
0
0
I am working on a project in visual studio that imports a csv, and exports an xml file. I'd like to be able to get the code to work as xml and html, and view it in a browser. I am getting this error when I load the xml file into a browser:

Firefox
XML Parsing Error: not well-formed Location: file:///C:/Users/fenwky/XmlDoc.xml Line Number 2, Column 6:?> -----^

Chrome
This page contains the following errors: error on line 2 at column 16: colon are forbidden from PI names 'xsl:transform'

This is what my c# code looks like in visual studio 2013:

           // Create a procesing instruction.
            XmlProcessingInstruction newPI;
            // Stylesheet
            String PItext = "<abc:stylesheet xmlns:abc=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">";
            newPI = doc.CreateProcessingInstruction("abc:stylesheet", PItext);
            doc.InsertAfter(newPI, doc.FirstChild);
            // Save document
            doc.Save(xmlfilename);


Viewing all articles
Browse latest Browse all 935

Trending Articles



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