Ah, NoteTab settings were for ANSI not ASCII encoding. A simple switch and
it works like a charm. Chris's tip also worked, although I'm more hesitant
to edit the dtd for such a piddly reason.
Thanks very much.
John
-----Original Message-----
From: Elizabeth Shaw [mailto:[log in to unmask]]
Sent: Thursday, July 08, 2004 10:41 AM
To: [log in to unmask]
Subject: Re: Inserting entities using XSLT
Hi,
Okay in the example I gave you I assumed that you wanted your character set
in UTF-8. The XSLT processor resolved character entities ot their UTF-8
representations.
That is only a problem if you can't read UTF-8 with your software. If you
must use the character entities then you should change your character set
for the output to ascii or latin-1.
So the beginning of your document should look like this
<?xml version="1.0" ?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp ' '>
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ascii"/>
This then retains the character entities in the output.
There is no reason to use disable output in this case.
From a purely technical perspective this is the right way to do this and
the others are kluges.
As to hte five default entities they are
amp
lt
gt
quot
apos
Each of these have special meaning to processors of XML.
The lt sign < is the beginning of the tag
the gt >indicates the end of the tag
the amp & indicates the beginning of an entity (character or general) the
quot " and apos ' are both used to encapsulate the values of attributes. So
XML provides entities to "escape" these characters.
THe default character set for XML (if you do not state otherwise) is UTF-8.
So when processing you need to keep in mind that they are going to resolve
entities by default to the UTF-8 character. Any character entity other than
the above 5 can be managed by the method above.
Liz Shaw
Steven Bernstein wrote:
> Dear EJ,
>
> Very good answer. Am curious though, what are the 5 default
> entities in XML? Steve Bernstein
>
>
>>>>[log in to unmask] 7/7/2004 7:19:27 PM >>>
>>>
> Since is not one of the 5 default entities in XML you need to
> include an entity declaration at the top of your styelsheet.
>
> <?xml version="1.0"?>
>
> <!DOCTYPE xsl:stylesheet [
>
> <!ENTITY nbsp ' '>
>
> ]>
>
> <xsl:stylesheet version="1.0"
>
> .....and so on
>
>
>
>
> Liz Shaw
> Aziza Technology Associates
> http://www.azizatech.com
>
>
>
> Rees, John (NIH/NLM) wrote:
>
>>I'm having trouble getting the  : entity to output using XSL.
>
> From
>
>>XML.com, <xsl:text disable-output-escaping="yes"><</xsl:text>
>>
>>produces the angle bracket, but I get a parse error with .
>
> Perhaps
>
>>this is an XT issue?
>>
>>Any advice is appreciated.
>>
>>John
>>
>>John P. Rees
>>Associate Curator, Modern Manuscripts
>>History of Medicine Division
>>National Library of Medicine
>>8600 Rockville Pike
>>Bethesda, MD 20894
>>
>>Phone: 301.496.8953
>>Fax: 301.402.7034
>>
>>
>
|