Return-Path: Delivered-To: apmail-xml-xalan-j-users-archive@xml.apache.org Received: (qmail 59804 invoked by uid 500); 8 Oct 2002 14:56:49 -0000 Mailing-List: contact xalan-j-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list xalan-j-users@xml.apache.org Received: (qmail 59792 invoked from network); 8 Oct 2002 14:56:48 -0000 Received: from sngate.sn.uk.prserv.net (HELO sngate.sn.uk.ibm.net) (195.75.81.65) by daedalus.apache.org with SMTP; 8 Oct 2002 14:56:48 -0000 Received: from SMTP (smith-nephew.com [62.184.176.15]) by sngate.sn.uk.ibm.net (8.9.1a/8.9.1) with SMTP id PAA74106 for ; Tue, 8 Oct 2002 15:58:35 +0100 Received: from SNSMTP02.relay.smith-nephew.com ([62.184.176.43]) by 62.184.176.15 (Norton AntiVirus for Internet Email Gateways 1.0) ; Tue, 08 Oct 2002 13:36:09 0000 (GMT) Received: from snwsav01.smith-nephew.com ([62.184.176.41]) by SNSMTP02.relay.smith-nephew.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2656.59) id TZ6ADMZ0; Tue, 8 Oct 2002 14:38:00 +0100 Received: FROM andsrv31.smith-nephew.com BY snwsav01.smith-nephew.com ; Tue Oct 08 14:37:37 2002 +0100 Received: by andsrv31.smith-nephew.com with Internet Mail Service (5.5.2656.59) id <4GBJY1LV>; Tue, 8 Oct 2002 09:36:36 -0400 Message-ID: From: "Koes, Derrick" To: "'Andrew Welch'" , "Koes, Derrick" Cc: xalan-j-users@xml.apache.org Subject: RE: Have we disobeyed a cardinal rule? Date: Tue, 8 Oct 2002 09:42:36 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Status: O X-Status: X-Keywords: Here is a snippet of what I've implemented, but does not work as desired. I simply get a \ in the input text field, if my original value was ". What have I done wrong? \" -----Original Message----- From: Andrew Welch [mailto:awelch@piper-group.com] Sent: Tuesday, October 08, 2002 4:28 AM To: Koes, Derrick Cc: xalan-j-users@xml.apache.org Subject: RE: Have we disobeyed a cardinal rule? DK: >The escape symbol shows up in the
*
. >It seems it's a usage problem rather than a data problem. Ahhh, in that case, you could add a param to your text() template that decides whether to call escape-string-for-javascript or not: \' So when you know that you want to escape ' to \' you can use: or on specific values: and when you just want to pass through the text unchanged just use: (typos in previous post sorted this time ;) cheers andrew -----Original Message----- From: Koes, Derrick [mailto:Derrick.Koes@smith-nephew.com] Sent: 07 October 2002 19:06 To: 'Steve Dwire'; xalan-j-users@xml.apache.org Cc: Courtney, Brian Subject: RE: Have we disobeyed a cardinal rule? That would work very well except for when the value needs to be used in an input field AND a for example. The escape symbol shows up in the . It seems it's a usage problem rather than a data problem. -----Original Message----- From: Steve Dwire [mailto:sdwire@parkcitysolutions.com] Sent: Monday, October 07, 2002 1:38 PM To: xalan-j-users@xml.apache.org Subject: RE: Have we disobeyed a cardinal rule? I'd suggest building an escape_quotes template to replace all single and double quotes with their escaped counterparts (\' and \", respectively). This would be a recursive template that outputs everything before the quote, then the backslash, then the quote, then everything after the quote run recursively through the 'escape_quotes' template again. Whenever you need to use an XML value in an attribute (or in a javascript, for that matter) call the escape_quotes template with the value. This lets the XSL decide what needs to be encoded and what doesn't, rather than expecting the XML provider to figure that out for you. The downside is the extra overhead of recursive processing in the XSL engine. ----------------------- Steve Dwire Park City Solutions 500 Park Blvd, Suite 295-C, Itasca, IL 60143 V: (630) 250-3045, x104 F: (630) 250-3046 DISCLAIMER: This message and any included attachments are from Park City Solutions Inc. and are intended only for the entity to which it is addressed. The contained information is confidential and privileged material. If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error please notify the sender of the delivery error by e-mail or call Park City Solutions Inc. corporate offices at (435) 654-0621 -----Original Message----- From: Koes, Derrick [mailto:Derrick.Koes@smith-nephew.com] Sent: Monday, October 07, 2002 12:23 PM To: 'xalan-j-users@xml.apache.org' Subject: Have we disobeyed a cardinal rule? We are transforming XML to HTML using XSLT. The problem is that some of the values used to populate the HTML forms have quotes (' " ') in them. These values seem to be in a fine state until they are used to populate HTML input elements. We don't URL encode/decode at the moment, but some experimentation has shown that if the values are persisted as URL encoded then are URL decoded and assigned to the appropriate elements AFTER the page loads (e.g. in a onWindowLoad javascript method) things are OK. We've also seen that this is only a problem when they are being assigned to attributes, since attributes use quotes to enclose their values. To summarize, it appears we will have to URL encode and URL decode all individual values (encoding/decoding as XML does not work well) for our app to use these values. Is this correct? Is there a better way to solve this problem? Thanks, Derrick This electronic transmission is strictly confidential to Smith & Nephew and intended solely for the addressee. It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. This electronic transmission is strictly confidential to Smith & Nephew and intended solely for the addressee. It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message. --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 03/10/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.394 / Virus Database: 224 - Release Date: 03/10/2002 This electronic transmission is strictly confidential to Smith & Nephew and intended solely for the addressee. It may contain information which is covered by legal, professional or other privilege. If you are not the intended addressee, or someone authorized by the intended addressee to receive transmissions on behalf of the addressee, you must not retain, disclose in any form, copy or take any action in reliance on this transmission. If you have received this transmission in error, please notify the sender as soon as possible and destroy this message.