How to display xml files with xsl and asp

Results 1 to 3 of 3

Thread: How to display xml files with xsl and asp

  1. #1
    Join Date
    Dec 1969

    Default How to display xml files with xsl and asp

    In the following piece of code a complete xml file is posted as a string from previous page(line 2). For that all quotation marks(") have been changed to single ones(&#039;), therefore in the following code this is reversed(line 3). Then I try to display the xml file(line 4). xml file uses an xsl file for displaying it correctly in a browser(IE5.5). Nothing is displayed, I receive only a blank page. What am I missing here? <BR><BR>If I save this xml string as .xml file(manually, not in this code I&#039;m working with) and then open it by double clicking it, it will be displayed correctly in a browser. So there is no errors in either the xml or xsl files. <BR><BR>I can display the file using DOM objects but I really wouldn&#039;t like to use that, since for some reason I don&#039;t know, it won&#039;t work with &#039;encoding="ISO-8859-1"&#039; which is used in the xml file. <BR><BR>Any help appreciated. <BR><BR>Code: <BR><BR>Dim strxml <BR>strxml = Request.Form("source") <BR>strxml = replace(strxml,"&#039;","""") <BR>Response.Write strxml

  2. #2
    Join Date
    Dec 1969

    Default It something to do with headers?

    What I would guess is that because the headers are not being set correctly, the browser isn&#039;t interpreting the XML page correctly.<BR><BR>I may be wrong - from the code you have given, the problem is exceptionally hard to isolate.<BR><BR>However, you may want to write back a set of HTTP Content-Type headers, setting the type manually to XML and see if that works. I can&#039;t remember the exact syntax, and I don&#039;t know the MIME type for XML, but it&#039;s probably something like:<BR>Response.ContentType = "text/xml"<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default MSXML Object ...

    .. has problems w/ different encoding methods. I have found that if you use VBScript to strip the encoding attribute from the XML PI it works.<BR><BR>-Doug

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts