[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem with rendering of &#160

Subject: Re: Problem with rendering of &#160
From: Julian Reschke <julian.reschke@xxxxxx>
Date: Wed, 14 Apr 2004 09:00:51 +0200
160 xslt problem
Richard.McMillian@xxxxxxxx wrote:
Thanks for info Tom, however with the change you suggested for the XSL, the
resulting HTML output still has this:
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">

The charset=UTF-16 is not the issue.  It is the content="text/html that
causes the
mal-rendering.  Is there an option to give the microsoft parser not to

What's wrong with that? Except possibly that the encoding *isn't* UTF-16?


default
to this content value?

function GenOrder(xmlstr, xslfile)
  dim xml, xsl, xslFileName, htmlDoc, tstr
  set xml = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
  xml.async = FALSE
  xml.validateOnParse    = FALSE
  xml.resolveExternals   = FALSE
  xml.preserveWhiteSpace = False
   WriteToLog ("GenOrder xmlstr = " & xmlstr)
   WriteToLog ("GenOrder xslfile = " & xslfile)
  if xml.LoadXML(xmlstr) then
    set xsl = Server.CreateObject("MSXML2.FreeThreadedDOMDocument.3.0")
    xsl.async = false
    xslFileName = Server.MapPath(xslfile)
    xsl.load(xslFileName)
    if xsl.parseError.errorCode <> 0 then
      tstr = "<pre>XML Doc XSL Error" & vbCRLF _
           & "Reason: " & xsl.parseError.reason  & vbCRLF _
           & "Line: "   & xsl.parseError.line    & vbCRLF _
           & "Src: "    & xsl.parseError.srcText & vbCRLF _
           & "</pre>"
    else
      tstr = xml.transformNode(xsl)

Now this is the popular ASP XSLT problem #1. Never ever transform to a string, because you'll use the intended encoding information. Always use transformNodeToObject (for instance writing to the Response object) instead.


end if
end if
set xsl = nothing
set xml = nothing
GenOrder = tstr
end function

Regards, Julian


--
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.