[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: Wed, 28 Jan 2004 11:34:46 -0500
nbsp nbsp
Michael Kay wrote:

Just want in your opinion the best way to deal with this issue so I can adopt it once and forget about it.




My usual practice is to use numeric character references for special characters in XML, ie. to write it as & #xa0; rather than & nbsp;

You don't need to do anything special in your stylesheet to copy the
NBSP character to the output. There are various ways the serializer can
render it (including as a non-breaking space, which probably won't show
up in your text editor) but they will all have the required effect.

Michael Kay


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





Michael,

now I am completely confused.

If my input xml file contains &nbsp; I add this entity reference to my xml file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE holdspace [<!ENTITY nbsp "&nbsp;">]>

Now when I open this xml file in XMLSpy I don't get the error message missing entity reference..character data..etc nbsp.

Great.

Now when I run my transform that I sent you against this xml input file the &nbsp that are originally in the xml file of course don't appear in my transformed output. What I get is <OBJECT></OBJECT> instead of my desired result <OBJECT>&nbsp;</OBJECT>.

Obviously I have something not declared properly in my xsl. Where do I place <!DOCTYPE holdspace [<!ENTITY nbsp "&nbsp;">]> in my stylesheet given I am using a syntax of

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
<xsl:template match="/">


Sincerely,

Scott

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.