[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How can the encoding of form data be specified in

Subject: RE: How can the encoding of form data be specified in XML/XSL
From: "Martinez, Brian" <brian.martinez@xxxxxxxxxxx>
Date: Wed, 28 May 2003 10:31:47 -0600
html form encoding
> From: Jeni Tennison [mailto:jeni@xxxxxxxxxxxxxxxx]
> Sent: Wednesday, May 28, 2003 3:03 AM
> Subject: Re:  How can the encoding of form data be specified in
> XML/XSL
> 
> 
> Hi Carsten,
> 
> > We use XML/XSL in browser to generate some HTML data. XML and XSL
> > uses ISO-8859-1 encoding. In some cases HTML forms are generated,
> > the form data is submited with an URL-encoded get to the server.
> >
> > We found that IE browsers encode the formdata in UTF8 before its
> > URL-encoded. Gecko browser just send ISO-8859-1.
> >
> > Is there a way to enforce a certain encoding of submitted data?
> 
> This is an HTML question rather than an XSLT one, since it's about how
> the browser behaves when it submits a form. You might try using the
> accept-charset attribute on the <form> element to specify the
> character encodings that you're willing to accept. Something like:
> 
>   <form action="filterform.htm" accept-charset="ISO-8859-1">
>     ...
>   </form>
> 
> Having said that, according to the HTML spec, browsers are supposed to
> use the same character encoding when submitting a form as was used for
> the HTML page itself. Perhaps IE is getting confused because you're
> doing the transformation client-side or perhaps it just always submits
> the form in UTF-8; it's hard to say without trying out the above.

In IE 5.5 at least, the default behavior is always to send URLs encoded as
UTF-8.  This can be changed in the Internet Options control panel, under the
"Advanced" tab, in the "Browsing" section.  I'm not sure if there is a way
to override this behavior programmatically; I did notice, however, that your
sample stylesheet lacked an explicit xsl:output element, which causes the
processor to default to XML output encoded as UTF-8.  You might try setting
the encoding of the HTML output explicitly in your stylesheet:

<xsl:output method="html" encoding="iso-8859-1"/>

cheers,
b.

|       please note new address and phone #'s effective may 19        |
| brian martinez                           brian.martinez@xxxxxxxxxxx |
| lead gui programmer                                    303.357.3548 |
| cheap tickets, part of trip network                fax 303.357.3380 |
| 6560 greenwood plaza blvd., suite 400           englewood, co 80111 |
| cendant travel distribution services   http://www.cheaptickets.com/ |

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.