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.

Bug 174910 - XSLT transformation in Netbeans within a PHP context
Summary: XSLT transformation in Netbeans within a PHP context
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: XSL (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Sergey Lunegov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-19 17:08 UTC by peteford
Modified: 2009-10-19 17:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Gzipped TAR of a rough attempt to work around this issue (5.90 KB, application/x-gzip)
2009-10-19 17:10 UTC, peteford
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peteford 2009-10-19 17:08:42 UTC
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
Comment 1 peteford 2009-10-19 17:10:39 UTC
Created attachment 89697 [details]
Gzipped TAR of a rough attempt to work around this issue