[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Empty object
Subject: Re: Empty object
From: scott gabelhart <swgabel@xxxxxxxxxxxx>
Date: Thu, 29 Jan 2004 10:21:13 -0500
|
Wendell Piez wrote:
Hi Scott,
At 03:57 PM 1/28/2004, you wrote:
in my final output I need to physically see <td> :</td>.
Currently my output contains <td>{a single space}</td>. The reason
being my OBJECT element is transformed to <td> and the original space
needs to be held within the outputed <td> </td>. If you open my
current output in IE you will see the famous A where my output
contains <td> </td>
By "the famous A" I take it you mean two characters, the
A-with-circumflex (a little "hat" on top) followed by a space: "Â " (I
paste it in hopes it'll come through).
In fact, this is what Internet Explorer shows when it's looking at a
UTF-8 non-breaking space, but it doesn't know the file is in UTF-8,
instead construing it in an older encoding (iso-8859-1 or some such).
In other words, you are in fact getting the correct character, only IE
is not showing it to you.
Adding an encoding declaration to your output -- perhaps even assuring
it's "safe" for IE by using <xsl:output encoding="iso-8859-1"/>
(assuming your processor will do that: most will) and thereby writing
in a character set that IE can handle, will fix this.
If you really want to post-process your file, or force your
post-transformation serializer, to substitute the non-breaking space
character with an entity reference (or rather, with a string that will
function as such in the serialized output), that can be done. See for
example http://www.xml.com/pub/a/2003/01/02/xmlchar.html. Doing this
in XSLT, however, isn't recommended for those who haven't fully
grasped the downside of the optional d-o-e feature.
It's far better, and usually much easier, to set up things so that
your browser recognizes what character encoding your document is
actually in, instead of just guessing wrong.
I might give more details on how to do this, only the whole thing
makes my head hurt, and I know there are others on this list who could
do a better job of it. But this is the oldest FAQ in the book.
Cheers,
Wendell
======================================================================
Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Wendell,
thanks for all the input. Fixed the problem yesterday afternoon.
xml input file
<snippet..>
<!DOCTYPE WITAGLIB [
<!ENTITY nbsp " ">
]>
xsl file
<snippet..with OBJECT template>
<xsl:choose>
<xsl:when test="text() = ' '">
<xsl:text
disable-output-escaping="yes">&nbsp;</xsl:text>
</xsl:when>
<xsl:otherwise><xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</td>
XHTML output file:
<snippet..>
<td
style="color:#000000;font-family:Arial;font-size:8pt;text-align:right;background-color:#FFFFFF;height:20px;width:98px;">$4.00</td>
<td
style="color:#000000;font-family:Arial;font-size:8pt;text-align:right;background-color:#FFFFFF;height:20px;width:98px;"> </td>
- Scott
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
- Re: Empty object, (continued)
- Wendell Piez - Wed, 28 Jan 2004 15:16:07 -0500 (EST)
- scott gabelhart - Wed, 28 Jan 2004 15:58:34 -0500 (EST)
- David Carlisle - Wed, 28 Jan 2004 16:47:16 -0500 (EST)
- Wendell Piez - Wed, 28 Jan 2004 17:43:47 -0500 (EST)
- scott gabelhart - Thu, 29 Jan 2004 10:21:50 -0500 (EST) <=
- Mike Haarman - Wed, 28 Jan 2004 15:35:01 -0500 (EST)
- scott gabelhart - Wed, 28 Jan 2004 16:18:34 -0500 (EST)
- Mike Haarman - Wed, 28 Jan 2004 17:04:32 -0500 (EST)
- scott gabelhart - Wed, 28 Jan 2004 22:01:45 -0500 (EST)
|
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|