XmlReader Problem

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top