Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2007, 12:36 AM
Authorized User
 
Join Date: Jul 2007
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default encoding="UTF-8"

Hi all,

I've noticed that while using the LibXSLT, I am not getting <b>encoding="UTF-8</b> in the resulting XML, even though the xml input contains the encoding info in it (<b><?xml version="1.0" encoding="UTF-8"?></b>).

Although its perfect with the rest of processor like Sablotron, Saxon and Xalan, may be LibXSLT takes it as a default one? I need to look into the manuals to find out the reason but just wanted the experts comments on it.

Secondly how I can make LibXSLT to output the encoding declaration for me in resulting xml.

Thanks in advance.







Pankaj
__________________
Pankaj
 
Old October 4th, 2007, 02:25 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

You could try specifying it in the <xsl:output encoding="UTF-8" /> declaration.

I suspect that the output is being output in UTF-8, just without then encoding being explicitly specified.

/- Sam Judson : Wrox Technical Editor -/
 
Old October 4th, 2007, 05:43 AM
Authorized User
 
Join Date: Jul 2007
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perfect.

How can I miss that. Thanks for reminding Sam.

Pankaj

Pankaj
 
Old October 4th, 2007, 05:27 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There is no reason why the encoding in the output should bear any relationship to the encoding in the input.

XSLT 1.0 states: "The xml output method should output an XML declaration unless the omit-xml-declaration attribute has the value yes. " It's only a "should", not a "must", but you're supposed to obey a "should" unless you have specific reasons not to, and it's not clear what those reasons might be. Complain to the vendor or use a different processor.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
encoding="utf-16" Problem francislang XSLT 7 April 10th, 2015 02:23 AM
UTF-8 sebastian Classic ASP Basics 0 March 16th, 2005 08:22 AM
utf-8 and ascii mail2atulmehta Classic ASP Databases 0 January 26th, 2005 11:22 PM
How to use Scriptupload + UTF-8 ? duydp Classic ASP Professional 1 October 20th, 2004 11:31 AM
UTF-8 msxml lpinho XML 4 January 28th, 2004 06:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.