Ephox EditLive! for XML supports multiple character sets which allow it to be used in an international environment. The character set used by EditLive! for XML can be defined in one of three ways:
Setting the character set via the Document.
Setting the character set via the XML Configuration file.
Setting the character set using the OutputCharset method of EditLive! for XML and the Visual Designer.
If no character set is specified, the default will be set to UTF-8 (in accordance to XML standards)
EditLive! for XML supports the display and usage of the following character sets:
American Standard Code for Information Interchange
Windows Latin-1
Eight-bit Unicode Transformation Format
Sixteen-bit Unicode Transformation Format
Sixteen-bit Unicode Transformation Format
JIS X 0201, 0208 in ISO 2022 form, Japanese
ISO 2022 KR, Korean
ISO 8859-1, Latin alphabet No. 1
ISO 8859-2, Latin alphabet No. 2
ISO 8859-3, Latin alphabet No. 3
ISO 8859-4, Latin alphabet No. 4
ISO 8859-5, Latin/Cyrillic alphabet
ISO 8859-6, Latin/Arabic alphabet
ISO 8859-7, Latin/Greek alphabet
ISO 8859-8, Latin/Hebrew alphabet
ISO 8859-9, Latin alphabet No. 5
ISO 8859-13, Latin alphabet No. 7
ISO 8859-15, Latin alphabet No. 9
Shift-JIS, Japanese
Chinese Big5.
The character set to be used within EditLive! for XML can be specified in the document to be loaded into EditLive! for XML. To set the character set in this way the XML declaration at the start of the document must specify the character set of the document to be loaded into EditLive! for XML. This is done by specifying a value for the encoding attribute.
A meta tag explicitly specifying the character encoding can be entered into the XML configuration file for the Visual Designer. For example, to specify character encoding of ASCII, the following tag should be entered between the document tags of the configuration file as such:
<editLive>
<document>
<html>
<head>
<meta
content="text/html;
charset=ASCII"
http-equiv="Content-Type"
/>
...
</head>
...
</html>
</document>
...
</editLive>If character encoding is specified in the configuration file then this will be the final character encoding used. If an instance of the Visual Designer uses the OutputCharset method the character encoding will still be set to the value specified in the configuration file.
In order to set the character set for EditLive! for XML via the XML file the character set must be specified in the <meta> element. For more information on the <meta> element and other XML elements see the EditLive! for XML XML Reference.
Using this method with the Visual Designer specifies both the character encoding for the XML components in the XSL, as well as the XHTML character encoding for document the XSL will generate. For example, if specifying character encoding ASCII for an instance of the Visual Designer, called vdesigner, in JavaScript:
vdesigner.setOutputCharset("ASCII");The XSL generated will contain the following tags:
<?xml version="1.0" encoding="ASCII"?>
...
<xs:template match="/">
<html>
<head>
<link href="stylesheet.css" rel="stylesheet"
type="text/css"/>
<meta content="EditLive! for XML 3.0.0.123"
name="generator"/>
<meta content="text/html; charset=ASCII"
http-equiv="Content-Type"
xmlns="http://www.w3.org/1999/xhtml"/>
</head>
<body>
...
</body>
</html>
</xs:template>Using this method with an instance of EditLive! for XML will specify the character encoding the XML generated. For example, if specifying the character encoding as ASCII the XML will be defined as follows:
<?xml version="1.0" encoding="ASCII"?>
For more information on the OutputCharset method see the OutputCharset section of the instantiation APIs in this SDK.
Copyright 2001-2005 Ephox Corporation. All Rights Reserved.