Solved

Error writing XML to Response object in ASP

Posted on 2004-04-14
5
1,040 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

17 Experts available now in Live!

Get 1:1 Help Now