Re: [xsl] Entities in XSL (again)

Subject: Re: [xsl] Entities in XSL (again)
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Wed, 17 Feb 2010 12:55:18 +0200

On 2/17/10 8:04 AM, Terry Badger wrote:
<wrapper>This is a&nbsp; sample</wrapper>

If the above is your XML then that also needs to contain a DOCTYPE declaration to define the entity.

The following stylesheet works ok for me in oXygen:

<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet xmlns:xsl=""; version="1.0">
<xsl:output encoding="utf-8" indent="yes" method="html"/>
<xsl:template match="/">
<xsl:copy-of select="."/>

tested with the following XML

<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<wrapper>This is a &nbsp; sample</wrapper>

Best Regards,
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Current Thread