Advertisement

04.30.2007 at 03:26PM PDT, ID: 22543813
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

ASP trouble reading an XML file

Asked by mastallama in Active Server Pages (ASP), Extensible Markup Language (XML)

Tags: ,

I'm trying to read an XML file using ASP (and I'm using the example from here: http://www.15seconds.com/issue/990527.htm ) but I keep getting 0 items returned.  I'm doing a  Response.Write(noOfHeadlines) and getting zero.  Does anyone have any ideas?

Here's my code...

<html>
<head>
<title>Read XML Test</title>
</head>

<body>
 <%
 Set objXML = Server.CreateObject("Microsoft.XMLDOM")
 Set objLst = Server.CreateObject("Microsoft.XMLDOM")
 Set objHdl = Server.CreateObject("Microsoft.XMLDOM")

 objXML.async = False
 objXML.Load (Server.MapPath("mostRecentScriptingNews.xml"))

' If objXML.parseError.errorCode <> 0 Then
'       handle the error
' End If

 Set objLst = objXML.getElementsByTagName("item")

 noOfHeadlines = objLst.length
 %>

 <HTML><BODY>
 <H1>Scripting News Headlines</H1>

 <%
 Response.Write(noOfHeadlines)
 For i = 0 To (noOfHeadlines - 1)

  Set objHdl = objLst.item(i)

  Response.Write("<a href=""" & _
                  objHdl.childNodes(1).childNodes(0).text & _
                  """>" & objHdl.childNodes(0).text & _
                  "</a><br>")

 Next
 %>
</body>
</html>

And here's the XML file...
<?xml version="1.0"?>
 <!DOCTYPE scriptingNews SYSTEM
      "http://www.scripting.com/dtd/scriptingNews.dtd">
 <scriptingNews>
   <header>
     <copyright>Copyright 1997-1999 UserLand Software, Inc.
     </copyright>
     <scriptingNewsVersion>1.0</scriptingNewsVersion>
     <pubDate>Wed, 03 Mar 1999 08:00:00 GMT</pubDate>
     <lastBuildDate>Thu, 04 Mar 1999 03:37:03 GMT</lastBuildDate>
   </header>
   <item>
     <text>Wired: A Linux Car Stereo! Wow.</text>
     <link>
       <url>http://www.wired.com/news/news/technology/ …
            story/18236.html
       </url>
       <linetext>A Linux Car Stereo</linetext>
     </link>
   </item>
   …
   <item>
     <text>According to News.com, Hewlett-Packard will offer
           customers storage and computing on a rental basis.
     </text>
     <link>
       <url>http://www.news.com/News/Item/ …
            0,4,33202,00.html?st.ne.fd.mdh
       </url>
       <linetext>According to News.com</linetext>
     </link>
   </item>
 </scriptingNews>

Thanks,
MastaLlamaStart Free Trial
[+][-]04.30.2007 at 04:30PM PDT, ID: 19005361

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2007 at 04:39PM PDT, ID: 19005401

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Extensible Markup Language (XML)
Tags: asp, noofheadlines
Sign Up Now!
Solution Provided By: steveberzins
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.30.2007 at 04:48PM PDT, ID: 19005432

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2007 at 05:10PM PDT, ID: 19005524

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2007 at 05:38PM PDT, ID: 19005636

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2007 at 05:48PM PDT, ID: 19005663

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.01.2007 at 06:43AM PDT, ID: 19008021

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32