XSLT should come from URL - patch for d6

shap - September 2, 2007 - 19:26
Project:XML Content
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:needs review
Description

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.

AttachmentSize
xmlcontent-xslt-url.patch2.12 KB

#1

mizerydearia - January 29, 2009 - 03:41

How do you apply the patch?

#2

kiamlaluno - March 2, 2009 - 19:05
Status:active» reviewed & tested by the community

The patch works, in my case.

#3

voipfc - June 10, 2009 - 20:03

Does it work in the Drupal 6 version?

#4

voipfc - August 31, 2009 - 16:51
Title:XSLT should come from URL» XSLT should come from URL - patch for d6
Version:5.x-1.x-dev» 6.x-1.x-dev
Category:bug report» task
Status:reviewed & tested by the community» needs review

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.

AttachmentSize
xmlcontent-xslt-url.d6.patch 1.88 KB

#5

javilete - October 9, 2009 - 21:37

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

voipfc - October 10, 2009 - 11:50

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.

 
 

Drupal is a registered trademark of Dries Buytaert.