>> English << | Français | Deutsch | Magyar | 中文 | Polski ZVON > Tutorials > XSLT Tutorial
>> Page 61 << | Prev | Next | Contents | Element Index

The encoding attribute specifies the preferred encoding to be used. The html output method should add a META element immediately after the start-tag of the HEAD element specifying the character encoding actually used. XSLT stylesheet 1 outputs in UTF-8, XSLT stylesheet 2 in UTF-16, and XSLT stylesheet 3 in Cp1250. In XSLT stylesheet 4 look at the source of the lowest middle window in your browser. The xml source contains characters which are not present in specified character set and they are therefore escaped.

XSLT stylesheet 1

XML Source
<source>

<html>
     <head>
          <title>HTML</title>
     </head>
     <body>
          <h1> HTML output </h1> ?í?ala ?nek ko?ka pa?ez be?ka mě?ec vyr
     </body>
</html>

</source>

Output
<html>
  
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
     
     <title>HTML</title>
     
  </head>
  
  <body>
     
     <h1> HTML output </h1>
     ?&iacute;?ala ?nek
     ko?ka pa?ez
     be?ka m&#283;?ec vyr  
     
  </body>
  
</html>

HTML view
HTML

HTML output

?í?ala ?nek ko?ka pa?ez be?ka mě?ec vyr