xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Dwire" <sdw...@parkcitysolutions.com>
Subject RE: Have we disobeyed a cardinal rule?
Date Mon, 07 Oct 2002 17:38:10 GMT
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 <http://www.parkcitysolutions.com>
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.

Mime
View raw message