Allow full paths
ashawley - July 31, 2007 - 20:43
| Project: | XML Content |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | weam |
| Status: | needs work |
Jump to:
Description
I'm interested in using this module to develop new modules and XML formats, and store their respective XSL sheet in the same location as that module. Currently, xmlcontent requires putting XSL and schema files in drupal/modules/xmlcontent. That's fine for a default behavior, but we'd like it to support full paths.
I've attached a patch that is a first swathe at supporting full paths, it probably needs work.
Thanks for this module.
| Attachment | Size |
|---|---|
| xmlcontent_5.x-1.x-dev_full-path.patch | 1.26 KB |

#1
I have just filed a bug that duplicates this request, but I think the patch I submitted is better. My variant first checks if the file name can be resolved in the module directory (which is a bad idea, but let us not break existing users). Failing that, it assumes that a URL has been entered and pulls the XSLT script from that URL. I think this subsumes your patch, because a file: URL can be used to fetch from an arbitrary local filesystem path (ignoring possible SELinux issues).
See http://drupal.org/node/172549
Sorry -- hadn't seen this. I consider this a bug rather than a feature issue, because it is an administrative problem to keep scripts in the modules tree.
Can you see if this patch accomplishes what you are trying to do? You will need to stick "file:" in front of your current path.
#2
I have hesitated about this point because of the file security issue. I am thinking to put an
XSLT_DIRvariable that is configurable by admin, and then have all XSLT under this directory (and make the default the module's). This way all needs are satisfied, and file paths remain within admin's control.Thank you both for the patches. I will look to them more closely and hopefully come back to you soon.