This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Best practice question, regarding escaped entitiy decla rations
- From: "Diamond, Jason" <Jason dot Diamond at MKG dot com>
- To: "'Snow, Corey'" <CSNOW at ddpwa dot com>, "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 26 Mar 2002 17:38:03 -0600
- Subject: RE: [xsl] Best practice question, regarding escaped entitiy decla rations
- Reply-to: xsl-list at lists dot mulberrytech dot com
> > 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 '£'>
]>
<xsl:transform version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
>
<xsl:output method='text' />
<xsl:template match='/'>£</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