XSLT should come from URL - patch for d6
| Project: | XML Content |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Current xmlcontent module requires that the XSLT script come from a path within the module tree. This is highly undesirable, and it seems unnecessary. A more appropriate solution would be to have the user specify a URL, which can fetch from client file system if desired by using file: prefix. Replacing current behavior with URL loads also allows XSLT scripts to be uploaded and used via the file upload extension (though security on that certainly requires care). Current behavior can be compatibly preserved by checking for file within module directory first.
Our use case for a general URL is that we want to maintain the XSLT script elsewhere under change control, and we want to fetch it from the repository via the repository web interface.
The attached patch repairs this in a backwards-compatible way. It checks first if the given location if a file found in modules/xmlcontent, and failing that it treats it as a URL. This requires moving the is_file() check earlier in the processing logic.
The patch additionally checks for errors on xslt load, which the module had not been doing.
Finally, it updates the tip string and the field label.
| Attachment | Size |
|---|---|
| xmlcontent-xslt-url.patch | 2.12 KB |

#1
How do you apply the patch?
#2
The patch works, in my case.
#3
Does it work in the Drupal 6 version?
#4
I have applied the above from patch from http://drupal.org/node/172549 to D6. Needs review but not much in there.
Main difference between D6 and D5 versions is the warning messages.
My very first patch.
#5
Well, I have been searching information in order that I could find the solution to my problem.
The problem is that how can I call to the function "_xmlcontent_transfmor" to show the form that I want from an xslt and an xml.
Anybody could help??
Thanks
#6
Are you trying to display content in a node that is in XML or create a form from it?
This module is for displaying XML.