troubleshooting Question

ASP and Extracting XML

Avatar of Overthere
Overthere asked on
ASPXML
7 Comments1 Solution181 ViewsLast Modified:
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 	 

Open in new window

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

Open in new window


this is what the xml section looks like:
<PASSENGERLIST>
      <PASSENGER>
        <LASTNAME>Rustler</LASTNAME>
        <FIRSTNAME>Ted</FIRSTNAME>
        </PASSENGER>
       <PASSENGER>
        <LASTNAME>Johnston</LASTNAME>
        <FIRSTNAME>Hartley</FIRSTNAME>
        </PASSENGER>
     </PASSENGERLIST>

Open in new window

ASKER CERTIFIED SOLUTION
zc2

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros