Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 5th, 2007, 08:57 AM
Registered User
 
Join Date: Sep 2007
Location: , , .
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>

Reply With Quote
  #2 (permalink)  
Old September 5th, 2007, 12:44 PM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old September 6th, 2007, 05:10 AM
Registered User
 
Join Date: Sep 2007
Location: , , .
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



Reply With Quote
  #4 (permalink)  
Old September 6th, 2007, 05:56 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
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
Reply With Quote
  #5 (permalink)  
Old September 6th, 2007, 12:10 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:48 PM.


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