G
Guest
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-comffice:spreadsheet">
<insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert>
<insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert>
</sql>
I am trying to read through the nodes in the sql element with VB.NET. At
the moment I am using...
Dim doc As System.Xml.XmlDocument
Dim reader As System.Xml.XmlTextReader
Dim nodes As System.Xml.XmlNodeList
Dim node As System.Xml.XmlNode
Dim root As XmlElement
Try
doc = New XmlDocument
Dim str As String
str = MapPath(".") & "\basic2.xml"
reader = New XmlTextReader(str)
doc.PreserveWhitespace = True
doc.Load(reader)
Catch ex As Exception
'output message
End Try
An exception is thrown on the line doc.Load(reader):
"There is no Unicode byte order mark. Cannot switch to Unicode."
What do i have to do to get this working?
Any help would be appreciated,
Jesse
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-comffice:spreadsheet">
<insert>INSERT INTO ClientCarriers VALUES ('AC',5)</insert>
<insert>INSERT INTO ClientCarriers VALUES ('AC',6)</insert>
</sql>
I am trying to read through the nodes in the sql element with VB.NET. At
the moment I am using...
Dim doc As System.Xml.XmlDocument
Dim reader As System.Xml.XmlTextReader
Dim nodes As System.Xml.XmlNodeList
Dim node As System.Xml.XmlNode
Dim root As XmlElement
Try
doc = New XmlDocument
Dim str As String
str = MapPath(".") & "\basic2.xml"
reader = New XmlTextReader(str)
doc.PreserveWhitespace = True
doc.Load(reader)
Catch ex As Exception
'output message
End Try
An exception is thrown on the line doc.Load(reader):
"There is no Unicode byte order mark. Cannot switch to Unicode."
What do i have to do to get this working?
Any help would be appreciated,
Jesse