Re: Correct quote escaping in href for javascript in WO 5.4

From: Mike Schrag (mschra..dimension.com)
Date: Mon Oct 29 2007 - 21:23:05 EDT

  • Next message: Doug McClure: "Official Rubicode Statement Regarding EOGenerator and Leopard"

    So apparently Me From Two Months Ago is smarter than Me From Now. The
    XML spec apparently says that apostrophes in attribute values is
    illegal and should be escaped as ' ... Whether this is enforced
    or not, I'm not sure.

    ms

    On Oct 29, 2007, at 8:31 PM, Brendan Duddridge wrote:

    > Yes, that is correct. WO 5.4 checkbox on = quote escape errors. WO
    > 5.4 checkbox off = NO quote escape errors.
    >
    > ____________________________________________________________________
    > Brendan Duddridge | CTO | 403-277-5591 x24 | brenda..lickspace.com
    >
    > ClickSpace Interactive Inc.
    > Suite L100, 239 - 10th Ave. SE
    > Calgary, AB T2G 0V9
    >
    > http://www.clickspace.com
    >
    > On Oct 29, 2007, at 5:45 PM, Mike Schrag wrote:
    >
    >> Hmm.. This SORT OF sounds like a bug. I would have thought single
    >> quote would actually be valid inside of a quoted string. I'm not
    >> sure why it would complain about single quotes in there. I'll have
    >> to take a look. And this only happens when WO 5.4 validation is
    >> specifically turned on?
    >>
    >> On Oct 29, 2007, at 7:32 PM, Brendan Duddridge wrote:
    >>
    >>> Hi,
    >>>
    >>> In WOLips on Leopard, I turned on the WO 5.4 validation. Now on my
    >>> components that have inline javascript, I get an error: "The
    >>> character ''' must be escaped"
    >>>
    >>> Here is a sample bit of HTML:
    >>>
    >>> <a href="#" onclick="itemView.activateTab('tab1');
    >>> itemView.findProductMatches();">Matches</a>
    >>>
    >>>
    >>> I'm not sure if I should be using &quote; or not to properly
    >>> escape the single quotes. After all, WO templates in WO 5.4 now
    >>> need to be valid XML documents as far as I know. I've already been
    >>> converting all my <br> tags to <br /> to clean things up.
    >>>
    >>>
    >>> I tried backslash quote ( \' ), but it didn't make the validator
    >>> happy. So what is the correct syntax?
    >>>
    >>> This syntax does validate, but I'm just wondering if it's correct:
    >>>
    >>> <a href="#" onclick="itemView.activateTab(&quot;tab1&quot;);
    >>> itemView.findProductMatches();">Matches</a>
    >>>
    >>> Will WO properly render the page with the quotes unescaped so the
    >>> javascript will function properly at display time?
    >>>
    >>>
    >>> Thanks,
    >>>
    >>>
    >>> ____________________________________________________________________
    >>> Brendan Duddridge | CTO | 403-277-5591 x24 | brenda..lickspace.com
    >>>
    >>> ClickSpace Interactive Inc.
    >>> Suite L100, 239 - 10th Ave. SE
    >>> Calgary, AB T2G 0V9
    >>>
    >>> http://www.clickspace.com
    >>>
    >>
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Mon Oct 29 2007 - 21:24:09 EDT