Forum How do I...?

Java interface - setBaseURL

lmen1990
What is the correct usage of setBaseURL in Java interface?

markup, css and image files are located (I am using Windows XP SP2)

C:\Prince\markup\test.xhtml
C:\Prince\markup\test.css
C:\Prince\markup\test.png

InputStream in = ...
OutputStream out = ...

// This does not work, C:\Prince\test.css: warning: can't open input file: No such file or directory
prince.setBaseURL("C:/Prince/markup/");

// If I add any char at the end, then it works
prince.setBaseURL("C:/Prince/markup/?");

prince.convert(in, out);
mikeday
The base URL is the URL of the file itself, so in your example it would be "C:\Prince\markup\text.xhtml". All relative URLs in the document will then be resolved relative to this.