Solved

Error writing XML to Response object in ASP

Posted on 2004-04-14
5
1,047 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

617 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