XmlReader Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the XmlReader to read the content of XML File.

However, If the XML contain "&" character, it will throw exception.

How to solve , any idea?
Thank You
 
Hello, Thank you for your reply, bu

It doesn't solve the problem for special character "<
Thank Yo

------------
strline = strm.ReadLin
Dim lineposition As Int3
lineposition = InStr(strline, "&"
If lineposition > 0 The
strreplace = "&amp;
Els
lineposition = InStr(2, strline, "<"
If lineposition > 0 The
strreplace = "<
End I
End I
 
Hej LaLaBoy,

I think there may be an error in the code you pasted. The line

strreplace = "<"

should be replaced with

strreplace = "&lt;"

Regards, Jakob.

----- LaLaBoy wrote: -----

Hello, Thank you for your reply, but

It doesn't solve the problem for special character "<"
Thank You

-------------
strline = strm.ReadLine
Dim lineposition As Int32
lineposition = InStr(strline, "&")
If lineposition > 0 Then
strreplace = "&amp;"
Else
lineposition = InStr(2, strline, "<")
If lineposition > 0 Then
strreplace = "<"
End If
End If
 
Back
Top