RE: ISO-8859-1 encoding and XmlDecl omision (was Re: [xsl] Lookin g up keys in a separate xml file)

Subject: RE: ISO-8859-1 encoding and XmlDecl omision (was Re: [xsl] Lookin g up keys in a separate xml file)
From: Sergio Rodriguez <srodriguez@xxxxxxxxx>
Date: Tue, 6 Jan 2004 10:14:56 -0600
Hi.

> John Meyer wrote at 06/01/2004 09:36 a.m.:
>I'm not sure I understand why 
>
><xsl:output method='xml' version='1.0' encoding='iso-8859-1'
>	omit-xml-declaration="yes" indent="yes"/>
>
>is invalid. ISO-8859-1 is a subset of UTF-8 and should cause no problems
>since most parsers default to UTF-8 if the XML declaration is ommited.

For my knowledge, that is incorrect.  Latin1 isn't a subset of UTF-8, for
the contrary, the opposite is true:  UTF-8 is a subset of Latin1.  If you
want to generate a XML document (result tree) that has *support* for Latin1
characters, like: á,é,í,ü,ë, etc. you have to generated the XML declaration
with Latin1 encoding (ISO-8859-1), otherwise the result would not be well
formed XML, just like David said:

...

>Note however that:
> 
> <xsl:output method='xml' version='1.0' encoding='iso-8859-1'
> omit-xml-declaration="yes" indent="yes"/>

>has incompatible options: you can't have latin1 output and omit the xml
>declaration (otherwise the result would not be well formed XML.
>The XSLt engine will be forced to ignore omit-xml-declaration="yes"
>here.
>
>David

Cheers,

Sergio Rodríguez.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread