"Andrea (Work)" ha scritto nel messaggio.
Sono d'accordo con te Andrea.
Infatti uso la seguente funzione che gira bene:
Public Function Testo_XML(ByVal T As String) As String
T = Replace(T, "&", "&")
T = Replace(T, "<", "<")
T = Replace(T, ">", ">")
T = Replace(T, Chr$(34), """)
T = Replace(T, "'", "'")
T = Replace(T, "à", "à")
T = Replace(T, "é", "é")
T = Replace(T, "è", "è")
T = Replace(T, "ì", "ì")
T = Replace(T, "ò", "ò")
T = Replace(T, "ù", "ù")
Testo_XML = T
End Function
Io nel mio progetto VB6 uso il riferimento:
Microsoft XML, v6.0
e quindi:
Public xDOC As MSXML2.DOMDocument
Set xDOC = New MSXML2.DOMDocument
xDOC.validateOnParse = False
'
If xDOC.Load(XMLnomeFile) Then
'Va bene
Else
' The document failed to load.
Dim strErrText As String
Dim xPE As MSXML2.IXMLDOMParseError
' Obtain the ParseError object
Set xPE = xDOC.parseError
With xPE
strErrText = "Your XML Document failed to load" & _
"due the following error." & vbCrLf & _
"Error #: " & .errorCode & ": " & xPE.reason & _
"Line #: " & .Line & vbCrLf & _
"Line Position: " & .linepos & vbCrLf & _
"Position In File: " & .filepos & vbCrLf & _
"Source Text: " & .srcText & vbCrLf & _
"Document URL: " & .url
End With
MsgBox strErrText, vbExclamation
End If
Il problema nasce appunto quanto è presente
il carattere ° (gradi).
In questo caso il LOAD genera errore e fa riferimento
alla riga in cui è presente il carattere °
Ciao Andrea e grazie.
Sauro