[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: Richard.McMillian@xxxxxxxx
Date: Tue, 13 Apr 2004 22:44:28 -0600
xml 160
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
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)
    end if
    end if
  set xsl = nothing
  set xml = nothing
  GenOrder = tstr
    
end function 
-----Original Message-----
From: Passin, Tom [mailto:tpassin@xxxxxxxxxxxx]
Sent: Tuesday, April 13, 2004 3:53 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx; xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Cc: jcouture@xxxxxxxxxxxxxxxxxxxx
Subject: RE:  Problem with rendering of &#160


From: Richard.McMillian@xxxxxxxx [mailto:Richard.McMillian@xxxxxxxx]
 
I have a problem with non-breaking space being rendered as a "?" question
mark by the IE webbrowser.
I looked at the output html and the hex character is A0 as is is supposed to
be; however the XSL automatically inputs
<META http-equiv="Content-Type" content="text/html; charset=UTF-16"> after
the header.   Changing the Content
value to iso-8859-1 results in the correct rendering of the A0.  Where does
the XSL derive this META tag
value from?  I've included an XML sample and the XSL code below.


-- Getting utf-16 by default has nothing to do with xslt - it is a
characteristic of the Microsoft xml/xslt processor, depending on how it is
used.  Getting the display you do is a tipoff that your browser does not
support that character in its own default encoding.  IE (in the US, anyway)
is generally expecting iso-8859-1,  so you get the nonbreaking space
rendering as intended when you use that encoding.

However, you have an error in the stylesheet.  You used a wrong encoding
value in the xsl:output element.  You should write

<xsl:output method="html" encoding="iso-8859-1"/>

An encoding of "text" is not a recognized character encoding, and I am
surprised you did not get an error from the processor.  Also, with the html
output method, you don't need to omit the xml declaration - since the output
is gong to be html and not xml, the xml declaration will not be inserted
anyway.

Cheers,

Tom P

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.