"uttara" <pl*******@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
AFN wrote: I'm comfortable with VB.NET but new to XML. I am getting XML data
from a remote machine across the internet. Sometimes my LoadXML call works
fine and I parse out the data I need thereafter. But other times, LoadXML
fails because it says it can't find a DTD file which is referenced in
<!DOCTYPE Response SYSTEM "The_File.DTD">. I don't know what a DTD file is, but
I don't have it and I'm just trying to parse the rest of the XML. There
are some elements there that I want to parse. I don't control the remote
server. What should I do?
DTD is a schema definition for the XML file. Are you trying to validate
the XML file that you receive?
No, I'm just trying to parse. Maybe I should be using the TextReader
object, but it doesn't take a string input and the XML is being passed to
this function as string. Someone else wrote the routine. Here it is, in
case you can offer any suggestions (thanks)...
Dim objDocXMLResponse As System.Xml.XmlDocument
Dim objResponseNodeList As Xml.XmlNodeList
objDocXMLResponse = New System.Xml.XmlDocument
objDocXMLResponse.LoadXml(strResponse)
objResponseNodeList =
objDocXMLResponse.SelectNodes("Response/ACResponse/CommonDataResponse/Common
MandatoryResponse")
Dim intNodeCount As Integer
For intNodeCount = 0 To objResponseNodeList.Count - 1
Dim objResponseChildNode As Xml.XmlNodeList
txRefNo =
getNodeValue(objResponseNodeList(intNodeCount), "TxRefNum")
strAuthNumber =
getNodeValue(objResponseNodeList(intNodeCount), "ResponseCodes/AuthCode")
strResponseCode =
getNodeValue(objResponseNodeList(intNodeCount), "ResponseCodes/RespCode")
Next