Solved

Error writing XML to Response object in ASP

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XML file fails to process correctly 3 64
Help with MSXML and Visual Studio 2013 1 50
XSLT: how to increment number value if attribute present 4 48
TSQL XML Namespaces 7 24
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…
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, …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 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