flyingsaucerproject / flyingsaucer

XML/XHTML and CSS 2.1 renderer in pure Java
Other
1.95k stars 549 forks source link

No way to set Document directly in renderer #298

Closed morvael closed 3 months ago

morvael commented 3 months ago

9.6.0 made most of setDocument methods private. I still need to use an option to provide Document object instead of String. This happened here (if I'm to believe release changelog): https://github.com/flyingsaucerproject/flyingsaucer/pull/281

In my case parsing html inside renderer causes an exception to be thrown. I use a more forgiving parser:

            Document document = Jsoup.parse(htmlData);
            document.outputSettings().syntax(Document.OutputSettings.Syntax.xml);
            document.outputSettings().charset(StandardCharsets.UTF_8);
            ...
            renderer.setDocument(new W3CDom().fromJsoup(document), "/");
asolntsev commented 3 months ago

fixed in https://github.com/flyingsaucerproject/flyingsaucer/pull/299, will be released as FS 9.7.1

asolntsev commented 3 months ago

@morvael FlyingSaucer 9.7.1 has been released. Now we have two public methods:

  1. setDocument(Document) // you probably need this
  2. setDocument(Document, String)