I have a snippet of coding which worked fine in my test page. Extracted everything I asked for.
I inserted it into my program and it does not extract my data
All of my other routines work well.
I did not receive any script errors, nothing in debugger, nothing in IE developer tools. Did not even write out my response.write statement.
There is nothing that should have caused this since my test page loads the same xml file.
I realize that saying I took it from my test page and inserted it into my going-to-be-production is subject to well, comments that there must be something transpiring that is causing the problem. But there isn't.
I have posted my snippet of coding and an example of the xml I am extracting. The only thing I can think of is that there are two sections that have passengers - I will post what that looks. I thought maybe it was getting confused. But that could not be because if it was, then my test page would not have worked - they are both using the same xml file.
All I receive is the "Passengers Next" and it just skips right over it the extraction rtn and hits the response.end line.
Any help appreciated.
Below is the coding from my test page and it works just fine. I get the first and last name for each one.
'extract passengers only if BID=NEW if (Session("BID") = "NEW") and (xdDoc.parseError = 0) then Set colNodes = xdDoc.selectNodes("//PASSENGERLIST/PASSENGER") 'if xdDoc.parseError = 0 then 'extract item info for each objItem in colNodes vlname = objItem.selectSingleNode("LASTNAME").text vfname = objItem.selectSingleNode("FIRSTNAME").text response.write "<BR>PASSENGER:" & vfname & " " & vlname next set colNodes = nothing 'end if else ' display error message end if
This is what I have in nearly-to-go-production page - you will notice I tried several definitions
response.write "<BR>PASSENGERS NEXT" if xdDoc.parseError = 0 then if (Session("BID") = "NEW") then vcounter = 1 ' Set colNodes = xdDoc.selectNodes("//PASSENGERLIST/PASSENGER") ' Set colChildNodes = xdDoc.selectNodes("SERVICECARD/SERVICE/PASSENGERLIST/PASSENGER") Set colChildNodes = xdDoc.selectNodes("SERVICECARD/SERVICE/PASSENGERLIST") 'extract item info for each objItem in colChildNodes response.write "INSIDE PASSENGERS LOOP<BR>" vlname = objItem.selectSingleNode("LASTNAME").text vfname = objItem.selectSingleNode("FIRSTNAME").text response.write "<BR>PASSENGER:" & vfname & " " & vlname ' vpassid = MkPassengers(vcounter,vlname,vfname) vcounter = (vcounter + 1) next set colChildNodes = nothing end if end if response.end
Thank you for responding....Will do...will post results in awhile...
Overthere
ASKER
Thank you! I found it and fixed it! Thank you for the tip on the parse error and good reference link. Can you recommend a really good book on xml? Can either be electronic or paperback...