-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: How to ignore html tags in a Criteria search
PostPosted: Mon May 26, 2008 7:51 am 
Newbie

Joined: Mon May 26, 2008 7:44 am
Posts: 2
Hi all from Spain.

I need to search with criteria over a varchar2 fiel that includes html tags. I would like to ignore the tags in my search.
For example:
If I´ve got the text "<strong>Hello world</strong>" in the database field, and I search from my application by the text "strong" (using criteria ilike method) I`ll obtain "Hello world" as result. I need html tag text was ignored.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 26, 2008 9:09 pm 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
I think you can use SAX parse to parse the html tag
http://en.wikipedia.org/wiki/Simple_API_for_XML


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 2:52 am 
Newbie

Joined: Mon May 26, 2008 7:44 am
Posts: 2
Thank you very much for your answer.

I think SAX is a good idea if I has the text-with-tags in a file or in a string, but I need ignore the tags while criteria is doing the search over the database.
I am looking for a way to use regular expresions (or so) to ignore everything between "<" and ">" characters while I am searching with criteria on the database.

Any idea?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.