I’m working on some cms-like system and want to refuse to post some "dirty" stuff into text area. Your library help me to clean out some tags like <script> etc. But is it possible to clean up something like this (see below)?
From: <div onclick="dirty_stuff()" style="dirty:stuff">blah-blah</div>
Well, not complitely. You may use HtmlCleaner to produce well-formed XML and after that serialize it to JDom for example where you can do what you want.
Could You write something more. I work on it a few hours and it's not so easy as it looks like. Could you give example how to do it?
HtmlClaner has no ability to remove specific attributes. The only thing you can do with it is to produce well-formed XML out from dirty HTML. With XML, you may do much more things - for details how to remove attributes from XML element, please check JDom or Xml DOM documentation.
Hvala na genijalnom parseru i ako mogu da korigujem ovu zadnju sa malko koda ;)
Before - > <table width="884" border="1" bordercolor="#000000" cellpadding="7" cellspacing="0">
tt = new TagTransformation("table","table",true);
After - > <table>
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.