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 September 5th, 2007, 08:57 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSL problem with italian characters

hi to everyone,
I have got an XML file and I want show it with the browser.

the XML includes some special characters like à, è, i...

when I try to transform the XML with the XSL, Internet Explorer doesn't show me nothing. Just the error

"<ins:Cognome>Cal"

the element into the xml file is <ins:Cognome>Calà</ins:Cognome>

The same happens everywhere there is a not conventional character.

below there is a piece of xsl.

The encoding used is UTF-8.

Can someone give me some help?

Thank



<table width="100%" border="1">
            <tbody>
                <xsl:if test="string-length(ins:DatiAnagrafici/ins:PersonaFisica/ins:Cognome)!=0">
                        <tr>
                            <td width="50%">
                                Creditore (Persona Fisica)
                            </td>
                            <td width="50%">
                                <xsl:value-of select="ins:DatiAnagrafici/ins:PersonaFisica/ins:Cognome"/><![CDATA[ ]]>
                                <xsl:value-of select="ins:DatiAnagrafici/ins:PersonaFisica/ins:Nome"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="50%">
                                Codice Fiscale
                            </td>
                            <td width="50%">
                                <xsl:value-of select="ins:Identificativo/@ins:CodiceFiscale"/>
                            </td>
                        </tr>
                        <tr>
                            <td width="50%">
                                Indirizzo
                            </td>
                            <td width="50%">
                                <xsl:value-of select="ins:DatiAnagrafici/ins:PersonaFisica/ins:Indirizzo"/>
                            </td>
                        </tr>

 
Old September 5th, 2007, 12:44 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Most likely explanation is that your input file is encoded either in iso-8859-1 or in Microsoft cp1252, but it doesn't contain an encoding declaration so the parser is assuming UTF-8. What happens if you display the XML file directly in the browser? What happens if you run the transformation outside the browser (in some environment that gives better diagnostics...).



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 6th, 2007, 05:10 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The files (XML and XSL) encoding is for both UTF-8.

If I display the xml file directly into the browser (IE), I get the error too.

If I display with firefox the file that I have got from the transformation , I can't see the character, but at least I don't get any error and I can see the file.

I downloaded I freeware tool yesterday (cooktop) and I get the error.

If you want I can send you both of file (XML and XSL).

Thank
Ciccio



 
Old September 6th, 2007, 05:56 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>If I display the xml file directly into the browser (IE), I get the error too.

OK, so you've got a bad XML file. No point running XSLT on it. You have to work out where it came from and how it came to be corrupt. Most likely it's simply using cp1252 encoding and doesn't say so in the header.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 6th, 2007, 12:10 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Try opening in Notepad, or similar, and using the bottom dropdown to save in UTF-8.

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
escaping of characters in xsl:attribute pramod Classic ASP XML 1 September 12th, 2008 09:11 AM
problem in some characters mmrz Oracle 1 October 18th, 2007 08:02 AM
problem in Some characters in oracle form10g mmrz C# 0 August 15th, 2007 02:16 AM
Accented characters transformation in XSL ROCXY XSLT 3 January 19th, 2006 08:50 AM
newline and tab characters problem anshul Beginning PHP 1 December 2nd, 2004 06:58 AM





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