Re: isEscaped

2008-09-03 Thread Ted Dunning
On Wed, Sep 3, 2008 at 11:33 AM, Garrett Smith <[EMAIL PROTECTED]>wrote: > This example: > > >> assertTrue( StringEscapeUtils.isHtmlEscaped("text") > ); > > > - is flawed. > > The flaw is searching for unescaped entities, not searching for no > unescaped entities. > ... You make some goo

Re: isEscaped

2008-09-03 Thread Garrett Smith
als(StringEscapeUtils.unescapeHtml(value))) { >... > } > Method unescapeHTML converts escaped entities to the unescaped character. That would not work. Because:- boolean isEscaped; String value = "Use this HTML: '<b>text</b>'"; isEscaped =

Re: isEscaped

2008-09-03 Thread Niall Pemberton
On Tue, Sep 2, 2008 at 7:28 PM, Gabriel Reis <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any tool to verify if a String is escaped? Something like this: > > assertFalse( StringEscapeUtils.isHtmlEscaped("text") ); > > assertTrue( StringEscapeUtils.isHtmlEscaped("text") ); Perhaps one way t

Re: isEscaped

2008-09-02 Thread Tim
What is the end goal? It seems you might end up taking more time trying to find out if it's HTML escaped then just coding for it on a usage basis. On Tue, Sep 2, 2008 at 1:28 PM, Gabriel Reis <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any tool to verify if a String is escaped? Something like t

Re: isEscaped

2008-09-02 Thread Garrett Smith
here are many entities. HTML Entities, XML Entities. isEscaped would have to account for a negation of all of unescaped entities. not: < | ' | " | & | \u00a0 should suffice reasonably well. The last one is nbsp or #160/ Garrett > On Tue, Sep 2, 2008 at 6:32 PM, F. Andy Seidl >

Re: isEscaped

2008-09-02 Thread Ted Dunning
gt;'") > > -- fas > > F. Andy Seidl > MyST Technology Partners, Inc. > > -Original Message- > From: Ted Dunning [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 02, 2008 2:48 PM > To: Commons Users List > Subject: Re: isEscaped > > Isn't

RE: isEscaped

2008-09-02 Thread F. Andy Seidl
e this HTML: '<b>text</b>'") -- fas F. Andy Seidl MyST Technology Partners, Inc. -Original Message- From: Ted Dunning [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2008 2:48 PM To: Commons Users List Subject: Re: isEscaped Isn't this a pretty

Re: isEscaped

2008-09-02 Thread Ted Dunning
Isn't this a pretty simple regex? Just look for <'s and &'s without entity syntax. On Tue, Sep 2, 2008 at 11:28 AM, Gabriel Reis <[EMAIL PROTECTED]> wrote: > Hi, > > Is there any tool to verify if a String is escaped? Something like this: > > assertFalse( StringEscapeUtils.isHtmlEscaped("text")

isEscaped

2008-09-02 Thread Gabriel Reis
Hi, Is there any tool to verify if a String is escaped? Something like this: assertFalse( StringEscapeUtils.isHtmlEscaped("text") ); assertTrue( StringEscapeUtils.isHtmlEscaped("text") ); []s Gabriel