Skip to content Skip to sidebar Skip to footer

Local Xsl Reference Within Xml-file

First a short task description: There is an XML file which references a xsl stylesheet which is within a *.dll. The beginning of this XML looks as follows:

Solution 1:

This is the solution:

<?xml-stylesheet type='text/xsl' href='res://C:%5CDocuments and Settings%5CAll Users%5Cname_xsl.dll/frameset.xsl'?>

Notes:

  1. You MUST use the res:// protocol to access a resource within a file.
  2. File system backslashes can be encoded as %5C . Possibly forward slashes will work as well.

Example: I tested this example for the file:// protocol, but it should work the same way as the res: protocol. On my system, I have a text file located at:

C:\Program Files\CodeGear\Delphi for PHP\2.0\privacy.txt

I can access this file, by putting into the nav bar of the Windows File Explorer:

file:///%ProgramFiles%/CodeGear/Delphi for PHP/2.0/privacy.txt

Notice backslashes converted to forward slashes, and no need to escape spaces. This has been tested and it works. The equivalent on the res protocol had not been tested, but it should work the same way, except of course that the res protocol is slightly different in that it also includes a resource index number.

Refer http://msdn.microsoft.com/en-us/library/ie/aa767740(v=vs.85).aspx for syntax.

Post a Comment for "Local Xsl Reference Within Xml-file"