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 July 24th, 2008, 08:27 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Spanish text problem

Hi,

Front End - XSLT/Java

I am trying to create a Spanish screen. Say i have a non ascii character ¿Continuar to be displayed as the button name.

Once i run the screen, i button name changes to %bfContinuar. Please help me.

 
Old July 24th, 2008, 09:46 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

It's easier to debug people's code when they show you the code...

My guess is you are including Javascript code within an HTML attribute that's designed to hold a URI. Instead of putting code in "href" attributes, put it in "onClick" where it belongs. Non-ascii characters in URI values will always be escaped using the %HH convention, which you don't want in Javascript code.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 24th, 2008, 09:58 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.
I dont use a javascript. I just use a form element. Here is the code:

<input type ="button" name = "test" value = "¿Confirmar"/>

When this is run, the screen displays it as %bfConfirmar

I also tried an alternate:

Screen1.xsl: i defined the label
<xsl:template name="labelConfirm">¿Confirmar</xsl:template>

Screen2.xsl: I called the label name from Screen1.xsl
<xsl:with-param name="text"><xsl:call-template name="labelConfirm"/></xsl:with-param>

Still i get the same result.

Quote:
quote:Originally posted by mhkay
 It's easier to debug people's code when they show you the code...

My guess is you are including Javascript code within an HTML attribute that's designed to hold a URI. Instead of putting code in "href" attributes, put it in "onClick" where it belongs. Non-ascii characters in URI values will always be escaped using the %HH convention, which you don't want in Javascript code.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 24th, 2008, 10:14 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

What does the actual HTML generated by your XSLT look like? (viewed as source with markup, not viewed in the browser)

How are you running the transformation: client side or server side? Which browser, which XSLT processor?

I can't see any reason why %HH escaping should be applied in the cases you show.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
 
Old July 24th, 2008, 10:36 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mhkay
 What does the actual HTML generated by your XSLT look like? (viewed as source with markup, not viewed in the browser)

How are you running the transformation: client side or server side? Which browser, which XSLT processor?

I can't see any reason why %HH escaping should be applied in the cases you show.

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

This is the code in the xsl file:
<input type ="button" name = "test" value = "¿Confirmar"/>

This is the Page Source:
<input type="button" name="test" value="%HH%bfConfirmar">

Transformation:
The Transformation is done at the Servlet -
transformer = templates.newTransformer()

Am using Both firefox and IE. I dont know which XSLT processor.

 
Old July 24th, 2008, 11:02 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by venkatragh82
 
Quote:
quote:Originally posted by mhkay
Quote:
 What does the actual HTML generated by your XSLT look like? (viewed as source with markup, not viewed in the browser)

How are you running the transformation: client side or server side? Which browser, which XSLT processor?

I can't see any reason why %HH escaping should be applied in the cases you show.

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

This is the code in the xsl file:
<input type ="button" name = "test" value = "¿Confirmar"/>

This is the Page Source:
<input type="button" name="test" value="%HH%bfConfirmar">

Transformation:
The Transformation is done at the Servlet -
transformer = templates.newTransformer()

Am using Both firefox and IE. I dont know which XSLT processor.

Few more information:
When i try this spain character (¿Confirmar) with a normal html page with out transformer = templates.newTransformer(), it works. This does not work when the xsl is transformed through transformer = templates.newTransformer().

Thanks
Venkat

 
Old July 24th, 2008, 11:03 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Looks weird: I'd say at first sight it's a bug in your XSLT processor. If you're running in a servlet and you don't know what processor you are using then it is probably the version of Xalan that comes bundled with the JDK. Report a bug, and try switching to the Apache version of Xalan (which is much more reliable) or to Saxon.

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript, Msxml2.XMLHTTP - Spanish Characters Pr itHighway Classic ASP Basics 1 November 14th, 2008 09:20 PM
Spanish to English!Code Translation Help C++ jigen7 C++ Programming 0 March 30th, 2006 12:28 AM
text sizing problem nerssi HTML Code Clinic 2 February 25th, 2005 05:03 AM
text box problem crmpicco HTML Code Clinic 2 January 24th, 2005 06:18 AM
Export Text problem Steven Access 1 July 7th, 2003 03:46 PM





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