The "href" attribute should be a URL. A Windows file path is not a URL. And even if you did make it a file:// URL the chances are that a browser would reject it on security grounds. Your best bet is to make the URL a relative one, that should be relative to the URL where the XML document was loaded from.
pramod talekar wrote:How to make a file path as a relative url ?
My xml file path is : - C:\Users\Pramod\Desktop\1.xml
and xsl is :- C:\Users\Pramod\Desktop\cdcatalog.xsl
Could you please give me some example.
Well, "some example" isn't what you are asking for, right? You start with the directory of the XML file. That's your base directory as far as the browser is concerned. (Sort of like the current working directory.) Then the relative URL of the XSL file is the path relative to that base directory. Also remember that you don't use backslashes in a URL.
My base directory is "C:/Users/Pramod/Desktop/".
Both files are kept on Desktop. I read somewhere that if both the xml and xslt files share the same path then it's not needed to mention the full path name in xsl:stylesheet.
So I tried writing href="cdcatalog.xsl" & "/cdcatalog.xsl" but it didn't work.