Hi everyone, I am retrieving some text from an RDB to display on a page. My problem, a browser error, occurs when there is an apostrophe ['] character in the text returned from the database. My first instinct was to use the html_quote attribute for the var tag, but that does not work for an apostrophe character. Here is an example: text returned from database = "Test' test test" <dtml-var dbText html_quote> This still produces the ' character in the html. Am I missing something? Does html_quote handle this character? Using Zope 2.5.1, MySQL 3.23.51 Thanks, Kevin
Kevin Carlson wrote:
Hi everyone,
I am retrieving some text from an RDB to display on a page. My problem, a browser error, occurs when there is an apostrophe ['] character in the text returned from the database.
Can you give us the error type, value and traceback please? cheers, Chris
The error is not a Zope error, it is a browser error. I receive the following warning from (IE 5.5) when the apostrophe character is present: Line:98 Char: 66 Error: Expected ')' Code: 0 URL: http://......... Kevin -----Original Message----- From: Chris Withers [mailto:chrisw@nipltd.com] Sent: Monday, October 07, 2002 9:41 AM To: Kevin Carlson Cc: zope@zope.org Subject: Re: [Zope] html_quote problem Kevin Carlson wrote:
Hi everyone,
I am retrieving some text from an RDB to display on a page. My problem, a browser error, occurs when there is an apostrophe ['] character in the text returned from the database.
Can you give us the error type, value and traceback please? cheers, Chris
Kevin Carlson wrote:
The error is not a Zope error, it is a browser error. I receive the following warning from (IE 5.5) when the apostrophe character is present:
Line:98 Char: 66 Error: Expected ')' Code: 0 URL: http://.........
This looks like Javascript barf. See Florent's post... cheers, Chris
Kevin Carlson <khcarlso@bellsouth.net> wrote:
I am retrieving some text from an RDB to display on a page. My problem, a browser error, occurs when there is an apostrophe ['] character in the text returned from the database. My first instinct was to use the html_quote attribute for the var tag, but that does not work for an apostrophe character. Here is an example:
text returned from database = "Test' test test"
<dtml-var dbText html_quote>
This still produces the ' character in the html. Am I missing something? Does html_quote handle this character?
It's perfectly legal to have an apostrophe in html. Your problem must lie somewhere else, you're probably using your variable in a context where an apostrophe is forbidden, like a javascript or a badly-quoted url. We need more info. What's the context where the browser complains? Florent -- Florent Guillaume, Nuxeo (Paris, France) +33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com
participants (3)
-
Chris Withers -
Florent Guillaume -
Kevin Carlson