Subject: Re: XSL output question
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 8 Sep 1999 09:30:51 +0100 (BST)
|
> I have an XML file that is encoding both with ISO-8859-1 and ISO-8859-2
> characters using external entities declaration (ISOlat1.pen and ISOlat2.pen).
> 1/ What is the value of the 'encoding' attribute within the XML
> declaration ?
You can use none as then the default utf8 encoding is used (which is what
you are using here)
> 2/ How could we generate an HTML file encoding in UTF-8 using an XSL
> stylesheet from this XML file ?
Most HTML browsers can't handle utf8, can they?
> Here is the declaration of the XML file :
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE TEI.2 [
<!ENTITY % ISOlat1 SYSTEM "/local/led/share/dtd/pen/ISOlat1.pen">
%ISOlat1;
<!ENTITY % ISOlat2 SYSTEM "/local/led/share/dtd/pen/ISOlat2.pen">
%ISOlat2;
]>
So this XML file is utf8 encoded, but probably you are only using the
first ascii-compatible block of utf8.
The entity files do not affect the _encoding_ they just give entity
references to named characters, with definitions as unicode character
numbers.
iso latin1 does not change the encoding of the file, it just defines,
for example
é
which it defines to be é (or equivalently é) You could
use this numeric character reference, or directly enter the unicode
character number 233 without needing to load the entity file.
The entity file only defines entity references .
The XSL engine doesn't really care whether you load these entity files
or not, whether you type é or é or é it always sees the
same character <Unicode-233> after the XMl parser has processed the
input document.
If you tell your xsl processor that you want to output HTML
put
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:output method="html" />
at the top and then it should just `do the right thing'with HTML
characters.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|