This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Best practice question, regarding escaped entitiy decla rations


> > You could also define an entity in your document's internal 
> > subset. That's
> > more convenient than using an XSLT variable since you don't 
> > have to use
> > xsl:value-of to output it.
> > 
> 
> Can you describe how this is done?

<!DOCTYPE xsl:transform [
	<!ENTITY pound '&#xA3;'>
]>
<xsl:transform version='1.0'
	xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>
	<xsl:output method='text' />

	<xsl:template match='/'>&pound;</xsl:template>

</xsl:transform>

Run this transform against any XML document (even itself), redirect the
output to a text file, and then open that text file in a Unicode aware
editor (like Notepad) and you'll see a single British Pound sign.

Almost all of my transforms have an internal subset at the top that define
things like nbsp, newlines, tabs, etc.

Jason

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]