For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > November 2005 > Help needed on XML problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help needed on XML problem
Peter Newman

2005-11-29, 6:55 pm

Im running VB6 SP6. I am trying with limited sucess to read an xml report. I
have managed to work my way through it and assign the values i need to
variables, hovever i am stuck on one last bit. i can get the error reason but
am stuck on how to get the MessageLine .. any suggestions ?


Set oErrorReasonNodes =
objDOMDocument.selectNodes("BACSDocument/Data/InputReport/Submission/UserFile/InputUserFile/Errors/Error/ErrorMessage")
For I = 0 To oErrorReasonNodes.length - 1
Set oChildReasonErrNodes = oErrorReasonNodes.nextNode
If (Not (oErrorReasonNodes Is Nothing)) Then
If I = ErrorCount Then
If Not IsNull(oChildReasonErrNodes.getAttribute("type")) Then
ErrorMessageType = oChildReasonErrNodes.getAttribute("type")
Else
ErrorMessageType = ""
End If
End If
End If
Next


XML Section

<ErrorMessage type="REASON">
<MessageLine>YOUR ACCOUNT DETAILS ARE INVALID</MessageLine>
</ErrorMessage>
Catherine Borbàs

2005-11-29, 6:55 pm

> Set oErrorReasonNodes =
> objDOMDocument.selectNodes("BACSDocument/Data/InputReport/Submission/UserFile/InputUserFile/Errors/Error/ErrorMessage")
> For I = 0 To oErrorReasonNodes.length - 1
> Set oChildReasonErrNodes = oErrorReasonNodes.nextNode
> If (Not (oErrorReasonNodes Is Nothing)) Then
> If I = ErrorCount Then
> If Not IsNull(oChildReasonErrNodes.getAttribute("type"))
> Then
> ErrorMessageType =
> oChildReasonErrNodes.getAttribute("type")



MessageLine =
oChildReasonErrNodes.selectSingleNode("MessageLine").text


> Else
> ErrorMessageType = ""
> End If
> End If
> End If
> Next



?

D.


"Peter Newman" <PeterNewman@discussions.microsoft.com> a écrit dans le
message de news: 5F088FA4-1AE6-4E09-91A3-E557EE290908@microsoft.com...
> Im running VB6 SP6. I am trying with limited sucess to read an xml report.
> I
> have managed to work my way through it and assign the values i need to
> variables, hovever i am stuck on one last bit. i can get the error reason
> but
> am stuck on how to get the MessageLine .. any suggestions ?
>
>
> Set oErrorReasonNodes =
> objDOMDocument.selectNodes("BACSDocument/Data/InputReport/Submission/UserFile/InputUserFile/Errors/Error/ErrorMessage")
> For I = 0 To oErrorReasonNodes.length - 1
> Set oChildReasonErrNodes = oErrorReasonNodes.nextNode
> If (Not (oErrorReasonNodes Is Nothing)) Then
> If I = ErrorCount Then
> If Not IsNull(oChildReasonErrNodes.getAttribute("type"))
> Then
> ErrorMessageType =
> oChildReasonErrNodes.getAttribute("type")
> Else
> ErrorMessageType = ""
> End If
> End If
> End If
> Next
>
>
> XML Section
>
> <ErrorMessage type="REASON">
> <MessageLine>YOUR ACCOUNT DETAILS ARE INVALID</MessageLine>
> </ErrorMessage>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com