AllExperts > Active Server Pages Programming (ASP) 
Search      
Active Server Pages Programming (ASP)
Volunteer
Answers to thousands of questions
 Home · More Active Server Pages Programming (ASP) Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Srini Nagarajan
Expertise
I can answer any kind of questions in ASP.NET, C#, VB.NET, SharePoint 2007, ASP, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience
Contact me if you need any custom development on ASP.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder.
 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > XML Parsing Continued

Active Server Pages Programming (ASP) - XML Parsing Continued


Expert: Srini Nagarajan - 5/23/2008

Question
Hi Srini, I ran out of follow-ups so they made me ask a new question. :) The last example you gave me works well when using an existing .xml file that lives on the local server. However, I get my XMl output from a remote PHP file on a server I have no control over. Because of that, I need to feed the contents of an XML file into the XMLDOM parser instead of a filename. That's where the hang-up is. See what I mean? All the stuff you showed me works beautifully if I have an actual local filename to feed into the parser, but I don't have that available unfortuantely. :( So again, this is the on thing I've tried so far with no success even though it "should" work in theory:

---
Set mydoc = Server.CreateObject("Microsoft.XMLDOM")
mydoc.loadXML(STRING_VARIABLE_CONTAINING_XML_CODE)
TotalA    = mydoc.selectNodes("//dce/response/watchlists/watchlist").length
TotalB    = mydoc.selectNodes("/dce/response/watchlists/watchlist").length
TotalC    = mydoc.selectNodes("dce/response/watchlists/watchlist").length
---

All 3 total variables end up being 0. :( Hopefully you can help me with this. Thanks again for your assistance Srini. It's appreciated.

Answer
Hi,

Sorry for i was away and just checking your email.

when you get the XML from different Server thru URL into STRING_VARIABLE_CONTAINING_XML_CODE, are you getting any data?

Did you display the XML also did you see what is the ERR you are getting?

If your XML comes like this including XML and RESPONSE header

<?xml...........>
<response .............>
  <dce>
            blah....
       </dce>

</response>

you should remove the first two lines, so that your /dce get the value directly.

I'll try to create a simple page for you and send the code once I am done.

Thanks

-Srini


Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.