ndeuma
ndeuma

Reputation: 759

Java library for CSS cleanup

For a rich text editor that has to handle pasted HTML code from MS Office applications, I'm looking for a Java library that cleans up the content of all "style" attributes in HTML elements, so that only some CSS attributes are left:

For creating a well-formed HTML document, I can use JTidy. For HTML element transformations (removing unwanted elements), I can use http://htmlparser.sourceforge.net/

Is there anything comparable for CSS attributes?

Upvotes: 3

Views: 561

Answers (1)

lexicore
lexicore

Reputation: 43651

Try using a some CSS parser (like http://cssparser.sourceforge.net/) and SAC.

Upvotes: 2

Related Questions