Solved

Error writing XML to Response object in ASP

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

752 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