logo       

Re: Omit-xml-declaration='yes' not working in UTF-16: msg#00147

text.xml.saxon.help

Subject: Re: Omit-xml-declaration='yes' not working in UTF-16


Minor detail for people trying out the example:
The copyright entity is © not 196. -

>>>>>Heres a copyright entity Ä to test:

Encoding is always good for extra bugs.

regards
Margaret Grün-Kerr

> MessageThanks alot,
>
> Its working now, downloaded saxon8.4 and used the
> omit-xml-declaration="yes" on the result document node as suggested.
>
> Thanks Ed, will post further Q's in the forum. Appologies for the spam.
>
> Neil
> ----- Original Message -----
> From: Andrew Welch
> To: saxon-help-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> Sent: Tuesday, June 21, 2005 9:57 AM
> Subject: RE: [saxon] Omit-xml-declaration="yes" not working in UTF-16
>
>
> Sorry I've just realised I've answered a different question the one
> you asked - you can use omit-xml-declaration="yes" on
> xsl:result-document now:
>
> http://www.w3.org/TR/xslt20/#element-result-document
>
> It's still worth reading up on encoding though - it's a thorny issue
> that comes up quite often.
>
> cheers
> andrew
>
> UTF-8 can handle multi-byte characters - it's not the output
> encoding that is causing you problems but the encoding that your
> browser is reading the file in. Try adding a meta declaration to
> your HTML either manually or by using the output method 'HTML' in
> your XSLT. Ultimately if you specified an output encoding of
> 'ASCII' you would have no problems, as all multibyte characters
> would be output as character references and therefore bypass the
> problem of encodings...
>
> Have a read of:
>
> http://www.dpawson.co.uk/xsl/sect2/N3353.html
>
> especially those by Mike Brown, who helped me a lot when I was
> learning this.
>
> cheers
> andrew
> Hi
> I'm trying to output an xhtml document using xslt 2 and saxon8.
> I'm trying to remove the xml declaration from the resultant
> document but this only seems to work in uft-8, although its
> suggests otherwise here.
> http://sourceforge.net/forum/message.php?msg_id=2877604
>
> My problem is that I have a double byte character in my xhtml
> which requires iso or utf-16 to render it. Can you suggest how I
> can remove the declaration and render the double byte character.
>
> ####### XML #######
>
> <?xml version="1.0" encoding="utf-8"?>
> <test>
> Here is a copyright symbol © to test:
> Heres a copyright entity &#196; to test:
> Heres a space hash160 between the braces (&#160;):
> Heres an ampersand entity &amp;
> </test>
>
> ####### XSL #######
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> xmlns="http://www.w3.org/1999/xhtml";
> xmlns:map="http://www.myorg.co.uk";>
>
> <xsl:output method="xml" encoding="utf-16" indent="yes"
> doctype-public="-//W3C//DTD XHTML 1.1//EN"
> doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";
> name="xhtml" omit-xml-declaration="yes" />
>
> <xsl:template match="/">
> <xsl:result-document href="test.html" format="xhtml">
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <title>MyCopyRightTest</title>
> </head>
> <body>
> <h1>TEST</h1>
> <p>
> <xsl:apply-templates/>
> </p>
> </body>
> </html>
> </xsl:result-document>
> </xsl:template>
> <xsl:template match="test">
> <xsl:apply-templates/>
> </xsl:template>
> </xsl:stylesheet>
>
> ####### RESULT #######
> <?xml version="1.0" encoding="utf-16"?>
>
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";
> xmlns:map="http://www.myorg.co.uk";>
> <head>
> <title>MyCopyRightTest</title>
> </head>
> <body>
> <h1>TEST</h1>
> <p>
> Here is a copyright symbol © to test:
> Heres a copyright entity Ä :
> Heres a space hash160 between the braces( ):
> Heres an ampersand &amp;
>
> </p>
> </body>
> </html>
>
> Thanks
>
> Neil A





-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise