mP.
mP.

Reputation: 18266

Does Flying Saucer accept HTML not XHTML

My original source is HTML not well formed XHTML. At worse i will have to clean and convert the html to xhtml and then feed flying saucer.

Upvotes: 0

Views: 2571

Answers (2)

mP.
mP.

Reputation: 18266

The Flying Saucer UserGuide answers my question.

Flying Saucer is an XML/CSS renderer, which means it takes XML files as input, applies formatting and styling using CSS, and generates a rendered representation of that XML as output. The output may go to the screen (in a GUI), to an image, or to a PDF file. Because we believe most people will be interested in re-using their knowledge of web layout, our main target for content is XHTML 1.0 (strict), an XML document format that standardizes HTML. However, we accept any well-formed XML for rendering as long as CSS is provided that tells us how to lay it out. In the case of XHTML, default stylesheets are provided out of the box and packaged within the library, which means Flying Saucer can render most XHTML out of the box with decent results.

Upvotes: 0

Jeff Burka
Jeff Burka

Reputation: 2571

Flying Saucer does not support HTML; as noted on its website: "No support for legacy HTML (although there are several open source Java HTML cleaners of varying quality available)." You might try one of the HTML cleaners they suggest, though. One of the best is, not surprisingly, HtmlCleaner.

Upvotes: 2

Related Questions