{"id":141,"date":"2008-07-01T15:56:39","date_gmt":"2008-07-01T23:56:39","guid":{"rendered":"http:\/\/www.curlybrace.com\/words\/?p=141"},"modified":"2010-12-15T19:07:16","modified_gmt":"2010-12-16T03:07:16","slug":"linking-to-xml-stylesheet-stored-on-local-server-in-firefox","status":"publish","type":"post","link":"https:\/\/www.curlybrace.com\/words\/2008\/07\/linking-to-xml-stylesheet-stored-on-local-server-in-firefox\/","title":{"rendered":"Linking to XML Stylesheet Stored on Local Server in Firefox"},"content":{"rendered":"<h3>Problem<\/h3>\n<p>I created an XML stylesheet which I wanted to place on a local Samba share.  In the XML file to be transformed, I placed a <tt>file:\/\/<\/tt> URI in the <tt>xml-stylesheet<\/tt> tag, but it wouldn&#8217;t work in Firefox.  Internet Explorer would happily format the content as expected, but Firefox simply displayed a rather uninformative error:<\/p>\n<blockquote><p><b>Error loading stylesheet: (null)<\/b><\/p><\/blockquote>\n<h3>Cause<\/h3>\n<p>As it turns out, I was formatting the URI incorrectly.<\/p>\n<h3>Solution<\/h3>\n<p>Proper URI formatting for the <tt>file<\/tt> protocol requires <b>three<\/b> slashes to establish an empty authority or host segment, followed by the full path, with all backslashes converted to forward slashes.  Since it was a path to a file on a local Samba server, which normally begins with two backslashes, this means I needed a total of <b>five<\/b> forward slashes following <tt>file:<\/tt>!<\/p>\n<p>So, given a Windows-style path such as:<\/p>\n<blockquote>\n<pre>&#92;&#92;myserver&#92;mypath&#92;mystylesheet.xslt<\/pre>\n<\/blockquote>\n<p>The corresponding URI would be:<\/p>\n<blockquote>\n<pre>file:\/\/\/\/\/myserver\/mypath\/mystylesheet.xslt<\/pre>\n<\/blockquote>\n<p>Yielding an <tt>xml-stylesheet<\/tt> tag like<\/p>\n<blockquote>\n<pre>&lt;?xml-stylesheet type=\"text\/xsl\"\r\n                 href=\"file:\/\/\/\/\/myserver\/mypath\/mystylesheet.xslt\"&gt;<\/pre>\n<\/blockquote>\n<h3>Reference<\/h3>\n<p><a href=\"http:\/\/kb.mozillazine.org\/Links_to_local_pages_don't_work\">MozillaZine:  Links to local pages don&#8217;t work<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem I created an XML stylesheet which I wanted to place on a local Samba share. In the XML file to be transformed, I placed a file:\/\/ URI in the xml-stylesheet tag, but it wouldn&#8217;t work in Firefox. Internet Explorer &hellip; <a href=\"https:\/\/www.curlybrace.com\/words\/2008\/07\/linking-to-xml-stylesheet-stored-on-local-server-in-firefox\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":3,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":1413,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/141\/revisions\/1413"}],"wp:attachment":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}