![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I have an XML file that I wish to load and use with VB.NET. It is in the structure: ?xml version="1.0" encoding="UTF-16"? sql xmlns:ss="urn:schemas-microsoft-com ffice:spreadsheet"insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert /sql snip An exception is thrown on the line doc.Load(reader): "There is no Unicode byte order mark. Cannot switch to Unicode." |
#3
| |||
| |||
|
|
"Jessard" <Jessard (AT) discussions (DOT) microsoft.com> wrote in message news:2312877E-A928-4D92-AB55-D6F6B346150B (AT) microsoft (DOT) com... Hi all, I have an XML file that I wish to load and use with VB.NET. It is in the structure: ?xml version="1.0" encoding="UTF-16"? sql xmlns:ss="urn:schemas-microsoft-com ffice:spreadsheet"insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert /sql snip An exception is thrown on the line doc.Load(reader): "There is no Unicode byte order mark. Cannot switch to Unicode." Saving the XML file as UTF-16 with a byte order mark would be best. How are you getting the XML file? |
#4
| |||
| |||
|
|
it is the result of a transform using my own stylesheet and VB.NET. ie. Dim sOutXML = MapPath(".") & "\template.xml" Dim whiteboardPath = MapPath(".") & "\whiteboard.xml" Dim xslTran As Xsl.XslTransform = New Xsl.XslTransform xslTran.Load(MapPath(".") & "\ClientsTemplate.xsl") xslTran.Transform(sOutXML, whiteboardPath) i don't necessarily want it to be UTF-16 but that is what results. I just want to be able to read it back again. "Daniel O'Connell [C# MVP]" wrote: "Jessard" <Jessard (AT) discussions (DOT) microsoft.com> wrote in message news:2312877E-A928-4D92-AB55-D6F6B346150B (AT) microsoft (DOT) com... Hi all, I have an XML file that I wish to load and use with VB.NET. It is in the structure: ?xml version="1.0" encoding="UTF-16"? sql xmlns:ss="urn:schemas-microsoft-com ffice:spreadsheet"insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert /sql snip An exception is thrown on the line doc.Load(reader): "There is no Unicode byte order mark. Cannot switch to Unicode." Saving the XML file as UTF-16 with a byte order mark would be best. How are you getting the XML file? |
#5
| |||
| |||
|
|
Hmm, sorry about the delay in responding. DO you think you could write a short but complete[1] console application taht exhibits the problem? It may be easier to diagnos that way. 1. http://yoda.arachsys.com/csharp/complete.html (examples are in C#, but it still applies) "Jessard" <Jessard (AT) discussions (DOT) microsoft.com> wrote in message news:5EEBD6F8-272D-4E2B-B69A-9B68F703F962 (AT) microsoft (DOT) com... it is the result of a transform using my own stylesheet and VB.NET. ie. Dim sOutXML = MapPath(".") & "\template.xml" Dim whiteboardPath = MapPath(".") & "\whiteboard.xml" Dim xslTran As Xsl.XslTransform = New Xsl.XslTransform xslTran.Load(MapPath(".") & "\ClientsTemplate.xsl") xslTran.Transform(sOutXML, whiteboardPath) i don't necessarily want it to be UTF-16 but that is what results. I just want to be able to read it back again. "Daniel O'Connell [C# MVP]" wrote: "Jessard" <Jessard (AT) discussions (DOT) microsoft.com> wrote in message news:2312877E-A928-4D92-AB55-D6F6B346150B (AT) microsoft (DOT) com... Hi all, I have an XML file that I wish to load and use with VB.NET. It is in the structure: ?xml version="1.0" encoding="UTF-16"? sql xmlns:ss="urn:schemas-microsoft-com ffice:spreadsheet"insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert /sql snip An exception is thrown on the line doc.Load(reader): "There is no Unicode byte order mark. Cannot switch to Unicode." Saving the XML file as UTF-16 with a byte order mark would be best. How are you getting the XML file? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |