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

Re: More entity confusion and my opinion on the right way

Subject: Re: More entity confusion and my opinion on the right way
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 05 Jan 1999 21:13:54 -0800
greeting.xsl greeting.xml
At 99/01/05 14:36 -0800, Andrew Bunner wrote:
>  Wrong.
>
>  &#32; (space) gets translated to the space character, not to &nbsp;

That is because &#32; is the space.

The value &#160; is the non-breaking space.

An example is attached below (with manually modified HTML to prevent mail
readers from rendering; just change all occurrences of "< " to "<").

........... Ken


T:\FTEMP>type greeting.xml
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="greeting.xsl"?>
<greeting><emphasis>Hello</emphasis>&#160;World!</greeting>

T:\FTEMP>type greeting.xsl
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
                xmlns="http://www.w3.org/TR/REC-html40"
                result-ns="">

<xsl:template match="/">   <!--the framework of a complete HTML file-->
  < html>
    < head>
      < title>Test< /title>
    < /head>
    < body>
      < xsl:apply-templates/>
    < /body>
  < /html>
</xsl:template>

<xsl:template match="greeting">
  < p><xsl:apply-templates/>< /p>
</xsl:template>

<xsl:template match="emphasis">
  < b><xsl:apply-templates/>< /b>
</xsl:template>

</xsl:stylesheet>

<!--end of file-->
T:\FTEMP>call xsl greeting.xml greeting.xsl greeting.htm
T:\FTEMP>type greeting.htm
< !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
< html>
< head>
< title>Test< /title>
< /head>
< body>
< p>
< b>Hello< /b>&nbsp;World!< /p>
< /body>
< /html>

T:\FTEMP>

--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.