Solved

Error writing XML to Response object in ASP

Posted on 2004-04-14
5
1,041 Views
Last Modified: 2008-07-22
I am running internet explorer 6 on windows xp, and
the following asp code (using localhost on IIS):
-----------------------

<%@ Language=VBScript %>
<%

      Dim strXMLFilename
      Dim strXSLFilename
      
      strXMLFilename = "c:\Inetpub\wwwroot\OasisWebRedesign\settings.xml"
      strXSLFilename = "clientdisplay.xml"
      
      
      Dim xml
      Dim xsl
      
      Set xml = Server.CreateObject("Microsoft.XMLDOM")
      xml.async = false
      xml.load(strXMLFilename)
      
      'Set xsl = Server.CreateObject("Microsoft.XMLDOM")
      'xsl.async = false
      'xsl.load(strXSLFilename)
      
      Response.Write(xml)
      
      Set xml = Nothing
      Set xsl = Nothing
%>


... returns the following error:   (why is this?)


HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Response object, ASP 0185 (0x80020003)
A default property was not found for the object.
0
Comment
Question by:Codescripter
  • 3
  • 2
5 Comments
 
LVL 26

Accepted Solution

by:
rdcpro earned 500 total points
ID: 10826367
'  Don't use Microsoft.XMLDOM!!  Old parser--not good for server.  Use MSXML 3 or 4

'    Version 3
'     Set xml = Server.CreateObject("Msxml2.DomDocument")
'    Version 4
     Set xml = Server.CreateObject("Msxml2.DomDocument.4.0")
     xml.async = false
     xml.load(strXMLFilename)

'    If you want to view XML, set the contenttype!
     Response.ContentType = "text/xml"

'     You can't write an object, you must write the xml property...which is why I name my xml objects xmlDoc...
'     Response.Write(xml.xml)  

'     But this is a MUCH better way.  Uses IStream:

     xml.save Response



Regards,
Mike Sharp

0
 
LVL 26

Expert Comment

by:rdcpro
ID: 10826392
Oh, and when you do the transform, don't use:

strHTML = xml.transformNode(xsl)
Response.Write strHTML

Use instead:

xml.transformNodeToObject  xsl, Response

Regards,
Mike Sharp
0
 
LVL 2

Author Comment

by:Codescripter
ID: 10827331
Thanks, Mike.

Btw, do you know of any xsl validators?

~Tom
0
 
LVL 26

Expert Comment

by:rdcpro
ID: 10827440
I use XML Spy.  It costs money (the IDE is a lot less than the Suite, but they don't really point that out), but the best ones always do.  Xcelerator by Marrowsoft is good to.  Both have debugging.

Regards,
Mike Sharp
0
 
LVL 2

Author Comment

by:Codescripter
ID: 10827653
Thanks again.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
.NET Xpath read sequence 5 47
installing and using WTP plugin eclipse MARS 3 97
Vb.net XML Read all nodes and 4 72
Problem to event 3 75
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now