[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re[2]: How can I avoid generating META tag of html
Then tell the stylesheet that it should switch the encoding. For example working with Cocoon 2: They completely deactivated the stylesheet's <xsl:output>. This will be handled in the sitemap. So depending on the request the serializer knows in which encoding it has to output the file. And you won't have problems with wrong encoding. For more information read http://xml.apache.org, the links for Cocoon 1/FAQ and Cocoon 2 (the server is down at the moment, so I can't give you the correct links). And if they can deactivate <xsl:output> and handle that in another way , you can do it too, I think. Regards, Joerg ----- Original Message ----- From: "Maxim Patramanskij" <max@xxxxxxx> To: "Julian Reschke" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Thursday, December 20, 2001 3:22 PM Subject: Re[2]: How can I avoid generating META tag of html? > Hello Julian, > > JR> *Why* do you want that? > > JR> Hint: don't say it's because you think the information is wrong. > > I will try to explain. I have a servlet, which implements site search. > It generates search result in xml and then tells to transformer to > apply transformation, having template. As well as I want to have > output multilanguage, all language-specific information stored in > Unicode format in .properties files and then selected according to > sending by browser http header Accept-language. > So, depending on browser's language, result's charset could be either > ISO-8859-1, Cp1251, at the moment. I set encoding value to the > > response.setContentType("text/html; charset=" + encoding) > > and then do transformation: > > transformer.transform(new DOMSource(xmlDoc), new StreamResult(response.getWriter())) > > If the browser's language was ru (Russian), I see nothing in browser, > untill manually change browser's encoding from UTF-8 to > Cyrilic(Windows), which is Cp1251. I do think it happens because > transformer creates the following in html head: > > <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> > > To avoid this behavior, I should additionaly do the following: > > transformer.setOutputProperty(OutputKeys.ENCODING, encoding); > > before starting the transformation. > > But after that, locale specific symbols (Cyrilic) became a sequence of > Unicode: > > <title>Результа</title> > > That's why I'm asking, how to avoid <meta...> generating to let browser > decide content encoding from http headers. > > Max > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|