preview of XSL files

Hi,


[

MacBookPro11,2

macOS 10.12.6 (16G1510)

]


XSL files are raw text files, with XML syntax.


Raw text files have a preview in the Finder. XML files also have a preview. But not XSL files.

Is it possible to configure something to correct this issue ?


Regards

MacBook Pro (Retina, 15-inch, Mid 2014), macOS Sierra (10.12.6)

Posted on Dec 3, 2018 12:13 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 3, 2018 3:01 PM

etresoft is giving you the answer; you will want to install a plug-in for QuickLook.


When you switch the name to .txt, you are using an existing QuickLook plugin for that format.


For XML and related and including XSL, maybe the following plugin helps?


GitHub - fabiolecca/colorxml-quicklook


There are various plugins posted around the net, and for various formats.


Here are a few:


Topic: quicklook-plugin · GitHub


For the local plugins, see ~/Library/QuickLook and if it's been created, see /Library/QuickLook for the system-wide plugins, and see the qlmanage command.


Here's the command to list the QuickLook plugins:


qlmanage -m plugins


Here's a write-up that might help with how this stuff works, and how to "borrow" or create a plugin for XSL files, too:


http://blog.10to1.be/cocoa/2012/01/27/creating-a-quick-look-plugin/

Similar questions

9 replies
Question marked as Top-ranking reply

Dec 3, 2018 3:01 PM in response to philippe.hippophile

etresoft is giving you the answer; you will want to install a plug-in for QuickLook.


When you switch the name to .txt, you are using an existing QuickLook plugin for that format.


For XML and related and including XSL, maybe the following plugin helps?


GitHub - fabiolecca/colorxml-quicklook


There are various plugins posted around the net, and for various formats.


Here are a few:


Topic: quicklook-plugin · GitHub


For the local plugins, see ~/Library/QuickLook and if it's been created, see /Library/QuickLook for the system-wide plugins, and see the qlmanage command.


Here's the command to list the QuickLook plugins:


qlmanage -m plugins


Here's a write-up that might help with how this stuff works, and how to "borrow" or create a plugin for XSL files, too:


http://blog.10to1.be/cocoa/2012/01/27/creating-a-quick-look-plugin/

Dec 3, 2018 2:14 PM in response to Eric Root

Hi,

thanks for your reply, but no, my problem is not how to deal with an XSL file.

My problem is only a problem with the Finder

When I select a text file, or an XML flie, QuickView shows me the beginning of the file content.

When I select a pdf, a bash file, a jpeg file and so on, QuickView shows the file content.

But when I select an XSL file, QuickView shows the BBEdit icon instead of the file content.

And if I change the file extension to .txt instead of .xsl, QuickView shows the file content.

So I suspect that there is somewhere a switch to configure so that .xsl files will be correctly displayed by QuickView.


Regards

Dec 3, 2018 8:15 AM in response to philippe.hippophile

Hello,

You will have to install some tool that can read and parse XSL files. Hopefully said app will include a QuickLook generator module that the Finder can use to preview these files. There are few people who use XSL so it may be difficult to find such an app. On my machine XSL files have a nice preview thanks to my installation of Xmplify (http://xmplifyapp.com/).

Dec 4, 2018 2:14 AM in response to MrHoffman

OK, I have tried these QL plugins, and some others.

The result is not up to my expectations. Currently, xml files (and even aup Audacity files) are displayed by QuickLook as text, without color, which is extremely fast, even for very large files. XSL files are not displayed.

With the plugin QLColorCode.qlgenerator, which is the best I found, the XML and XSL files are displayed, but in a very small icon that does not allow reading (it is too small). You have to press the space bar to see the file, but for a large file it takes a long time to display the content.

Actually, I don't need much. I'm not interested in colorization or syntax highlighting.

Without a new plugin, XML files are displayed by QuickLook as raw text, not in a small icon, but over the full width available in the Finder column. The .aup files (Audacity) also. I would just like the same to be true for .xsl files.

I guess there is somewhere a mapping table that I could modify so that the processing of .xsl would be the same as that of .xml ?


Thank's for your help !


Regards

Dec 4, 2018 10:45 AM in response to philippe.hippophile

I copied the Text.qlgenerator from /System/Library/QuickLook into my local ~/Library/QuickLook folder. I opened the Info.plist in Xcode, and added another entry to include text/xsl (or public.xsl), and neither ultimately worked. I then came across some code (probably stack overflow, but I did not retain the link), that allows one to select the .xsl document, and then run the AppleScript to dynamically display the .xsl content in a Quick Look window.


-- ql_xsl.applescript

-- select a .xsl document, and then run this script to display the .xsl content

-- in a QuickLook window.

tell application "Finder"

set _files to selection

repeat with _file in _files

do shell script "qlmanage -p -c public.plain-text " & POSIX path of (_file as alias) & " 2> /dev/null &"

end repeat

end tell

return

Dec 6, 2018 11:46 PM in response to VikingOSX

Hi,

Thank's for your reply.

** that's not what I'm looking for. When I select an XSL file in the Finder, I want to see the beginning of its content, instantly, in the right column of the Finder, exactly as if it were a .txt file or an .xml file.

I don't want to have to perform a specific action on this file once it is selected, because in that case, I might as well open it with BBEdit, and I'll see its content.

I would like the Finder to believe that XSL files are to be treated as text files, as far as quicklook is concerned.

Regards


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

preview of XSL files

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.