0

I'm trying to switch to JavaFX Webkit from ancient JEditorPane to render html. As the old browser does not support xml+xslt transformation we do the html with own internal custom URL scheme 'xslt'. As addition we use a 'internal' url scheme that loads all required stuff with classloader.

Custom URL handlers are registered ok, for example browsing to link

'xslt:internal:/foo/bar/init/help/index.xml'

is caught by tranforming routines and HTML is created ok. All required xslt files are found etcetc.

Unfortunately the webkit fails to follow relative links in the HTML. There is for example css (href="../../init/style.css) and links to other documents (for example help.xml) that do not work. CSS is not applied and nothing happens when the link is clicked.

Somehow it seems that webkit loses the root path (xslt:internal:/foo/bar/init/help) when calling these resources. I never see calls to either CSS or to help.xml.

As a side note, links work if the transformation is made by the webkit. And naturally this all works ok in the old JEditorPane component.

I'm not sure how to investigate this problem. Could the exotic URL schemas cause the webkit ignore relative paths?

iamsankalp89
  • 4,607
  • 2
  • 15
  • 36
mikam
  • 1
  • Relative links in generated HTML for a `JEditorPane` will fail as well, unless the base is specified. [e.g.](https://stackoverflow.com/a/18443485/418556) – Andrew Thompson Sep 11 '17 at 11:23
  • I bet this has something to do with double scheme in the URL. Maybe the old JEditorPane was so primitive it didnt get confused. – mikam Sep 11 '17 at 11:39

0 Answers0