Mike Thompson wrote: > Thanks again. That was too easy. > > My final problem with this attempt: > The style sheet is located at: > file:/H:/Application%20Data/XMLmind/XMLEditor/addon/docbook/xsl/html-review.xsl > > > which is a microsoft share. If I use that explicitly, it works fine. > > However, if I use getApp().getActiveOpenedDocument().getConfiguration(); > to get the configuration file, and then locate the style sheet relative > to that directory, the API returns a URL containing the UNC (e.g., > "file:/tinsman-v/me/Application%20Data/XMLmind/XMLEditor/addon/docbook/xsl/html-review.xsl") > > rather than the drive letter. And it fails to find the style sheet. > > I suspect the UNC problem is not new. Is there any reasonable solution?
[1] "file:/tinsman-v/me..." does not specify an UNC path. It should start with "file://tinsman-v/me...". [2] In all cases, Java cannot handle file://server/path URLs. Use XMLmind's utility FileUtil.urlToFile(URL) to convert this kind of URL (provided that its starts with "file://") to a java.io.File object. See http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#getStyleSheetInfo() [3] Why not use directly getApp().getActiveOpenedDocument().getStyleSheetInfo()? This directly lists all the CSS style sheets associated with current document. See http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocument.html#getStyleSheetInfo()

