Subject: Re: xslt replace special characters
From: "Noel Golding" <noel@xxxxxxxxxxxxxxx>
Date: Mon, 11 Nov 2002 15:29:44 -0500
|
if it is a webpage, then javascript to replace the characters is ok, but it
may be safer to do the replace on the server, before parsing.
----- Original Message -----
From: "Greg Faron" <gfaron@xxxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, November 11, 2002 3:00 PM
Subject: Re: xslt replace special characters
> Alice,
>
> This is going way off-topic, but...
>
> You still haven't described the environment of the UI, so I'll assume
> it's an HTML page. If so, use a simple JavaScript function to replace all
> occurrences of '&' with '&' in your textfield value prior to the
form's
> submission.
>
> <script type="text/javascript">
>
> function mySubmit()
> {
> document.true_url.value = convert(document.url.value);
> document.myform.action = "real form url here";
> document.myform.submit();
> // 'true_url' will have the "encoded" url value.
> } // ends mySubmit(void)
>
> function convert(url)
> {
> var re = /&/g;
> return url.replace(re, "&");
> } // ends convert(String)
>
> </script>
> ...
> <form name="myform" action="javascript:;" method="post">
> <input type="text" name="url" value="" />
> <input type="hidden" name="true_url" value="" />
> <input type="button" value="Submit" onclick="mySubmit();" />
> </form>
>
> Greg
>
> At 12:36 PM 11/11/2002, you wrote:
> >Thanks Greg. Right in the UI, we want the user to enter their URL. Their
> >URL will most likely have name/value pairs. Is there an easier
> >way? There is no otherway of filtering '&' before it gets processed in
> >the XSL?
> >
> >Alice
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- Re: xslt replace special characters, (continued)
- Alice Fan - Sun, 10 Nov 2002 22:16:25 -0500 (EST)
- Greg Faron - Mon, 11 Nov 2002 13:44:51 -0500 (EST)
- Alice Fan - Mon, 11 Nov 2002 14:32:37 -0500 (EST)
- Greg Faron - Mon, 11 Nov 2002 14:57:28 -0500 (EST)
- Noel Golding - Mon, 11 Nov 2002 15:35:07 -0500 (EST) <=
- Mike Brown - Mon, 11 Nov 2002 15:34:30 -0500 (EST)
- Alice Fan - Mon, 11 Nov 2002 14:53:15 -0500 (EST)
- Passin, Tom - Mon, 11 Nov 2002 15:10:14 -0500 (EST)
- Alice Fan - Mon, 11 Nov 2002 15:46:06 -0500 (EST)
|
|