Technology Tales

Adventures & experiences in contemporary technology

java.net.MalformedURLException: unknown protocol: j

15th December 2007

I know that that there better things to call a blog post than to use part of an error message that I got from Saxonica‘s Saxon while I was converting XML files into PHP equivalents for the visitor information section of my main website. I use the open source Saxon-B rather than the commercial Saxon-SA and it fulfils all of my needs and version 8 and later (it has now reached 9.0.0.2) handle the XSLT 2.0 features that I need to make the transformations really clever. Also, because Saxon is available as a jar file, it is cross platform so long as you have Java on board. There are, however, some slight differences in behaviour. I now run thte thing in Linux and any Windows-style file locations are not recognised. I had the file path in a DTD declaration starting with "J:\" and that was thought to be a protocol like file, http, https, ftp and so on because of the colon. There’s no j protocol so Java gets confused and, voilà!, you get the rather obscure error that titles this post. Otherwise, the migration of the Perl script that creates XSLT files and fires off the required XML to PHP transformations was a fairly straightforward exercise once file locations and shebang line were set right.

  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.