This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using NetBeans to develop and text XSLT works well, but it is limited to operating within a Java context. This means that extension functions used in any XSLT files must be written in Java. When working with NetBeans as a PHP development environment, it is sometime convenient to use PHP functions within XSLT. The PHP XSLTProcessor class allows for registering PHP functions for such use, and there is a defined syntax for calling these functions within the XSLT. I use, for example, a simple text-translation function called xl() which looks up a string a provides the language-sensitive version in it's place. This can be called in XSLT like <xsl:value-of select='php:function("xl",string(.))' disable-output-escaping='yes'/> Unfortunately NetBeans doesn't handle with this function construct gracefully, and complains "The first argument to the non-static Java function 'function' is not a valid object reference.", presumably because it doesn't expect PHP functions in there! It would be nice to be able to choose the XSLT processor used by NetBeans for the "XSL Transformation..." action, or at least have it sensitive to the project context (Java in a Java project, PHP in a PHP project) My initial work-around was to try to write a plug-in which could pass the XSL and XML to a small PHP command line program and grab the result. I have attached a project containing my first draft of this idea, although I'm pretty sure this is not the best way to go about this functionality
Created attachment 89697 [details] Gzipped TAR of a rough attempt to work around this issue