Hi,
I’m writing a snippet that takes the URL of a remote XML feed, and the location of a local XSL file, and applies the XSL transformation to the XML and outputs the result. So far so good. However, I would like to be able to pass parameters from the snippet call to the XSL processor. This can be done easily enough in PHP, by sending "parameterName"=>"parameterValue" pairs to the XSL processor call.
However, I am wondering what is the best way to be able to send "parameterName" and "parameterValue" to the snippet (neither are known at the time of writing the snippet). I have written a snippet that can take an option that contains all the pairs that are sent to the XSL processor, such as in the following example:
&xslParams='listLength:3,showSummaries:0'
Then in the snippet code I use some PHP string functions and a loop to extract the parameter name and values from the $xslParams variable. Is there some other "proper" MODx way to send a list of key=>values to a snippet which I don’t know about? If no, could there be some future problems doing it the way I have done it?
Regards,
Michal.