Last active
March 24, 2016 21:55
-
-
Save grantmacken/929cbb7a041ae5e07132 to your computer and use it in GitHub Desktop.
make function to get the right mime-type from an extension using #eXistdb mimetypes file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getMimeType = $(shell java -cp $(SAXON) \ | |
net.sf.saxon.Query \ | |
\!method=text \ | |
-qversion:3.1 \ | |
-qs:"doc('file:///$(EXIST_HOME)/mime-types.xml')//mime-type[matches(./extensions,'\$(1),|\$(1)$$')]/@name/string()"\ | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$(SAXON) points to saxaon-he jar
param $(1) is a file extension like '.xq'