Eclipse Plugin 9.3.0 custom Java ext fn errors

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

Hi all,

I've got a project in Eclipse with the Oxygen eclipse plugin installed. The project has a mix of Java and XSL in the source folders. The XSLs have extension function calls out to the Java code in the same project. All runs well when I actually run the code and XSL but, in the editor, there are lots of red lines indicating that there are errors against every custom java extension function. If I write some XPath to run some standard JDK library java code, there are no errors in the IDE so I know that this is a classpath issue, i.e. the code in my project isn't being added to the classpath of the validation engine when it validates the XSL. A typical error in the Problems tab in eclipse is:

Description Resource Path Location Type
[Saxon-B 9.0.0.6] XPath syntax error at char 14 on line 147 in {cp:getId($pub)}:
Cannot find a matching 1-argument function named {java:uk.co.mypackage.MyClass}getId()
@see: http://www.w3.org/TR/xpath20/#ERRXPST0017 myxsl.xsl

The extension function is there and valid and, like I say, it runs fine when I execute the XSL - it's just that my editor is annoyingly covered in red lines.

Any ideas to include the classes generated by the Java code in the same project to be injected into the validator.

Many thanks.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by sorin_ristache »

Hello,

You have to specify your Java extensions in a validation scenario associated with the validated XSLT stylesheet.


Regards,
Sorin
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

Why do I need to configure a validation scenario? The XSL must be valid for all scenarios given what's on the classpath for the project. From an eclipse point of view, that's whatever classes are available to the project, i.e. are on the classpath - so things like the jdk classes from the project's selected JVM, the project's classpath libraries / dependent projects, and any code in source folders in the current project should be available for the XSL to use to call a Java extension function. No more and no less.

Is the creation of a validation scenario a workaround for the eclipse plugin - I can see why you'd use it in the standalone version of Oxygen as you'd have to import the jars that contain the extension functions.

Also, I work as part of a team and we all must share the same validation scenario across team members - typically by committing a file to cvs - can this be done?

Do I need to create a validation scenario for each XSL individually? The docs look like that's what I have to do.

Does the validation scenario pick up changes to the Java code in the current project dynamically, e.g. change the interface of a java method and all of a sudden the XPath in the XSL is invalid?

Sorry for all the questions - I just want to get the most out of the product and use it most effectively.

Many thanks.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by sorin_ristache »

Hello,
dhallam wrote:Why do I need to configure a validation scenario? The XSL must be valid for all scenarios given what's on the classpath for the project. From an eclipse point of view, that's whatever classes are available to the project, i.e. are on the classpath
In the current version the validation does not look for extensions in the Java projects that are currently opened in Eclipse. In a future version the validation will look for the Java extensions in the classpath of the opened Eclipse projects.
dhallam wrote:Also, I work as part of a team and we all must share the same validation scenario across team members - typically by committing a file to cvs - can this be done?
The scenarios are saved in the Eclipse preferences. The transformation scenarios can be exported to a file that can be shared with other users but in the Eclipse plugin this is not available for the validation scenarios. We will add that in a future version of the Eclipse plugin.
dhallam wrote:Do I need to create a validation scenario for each XSL individually? The docs look like that's what I have to do.
You can create only one validation scenario with the default value ${currentFileURL} in URL field and associate it with each XSL that calls a Java extension function.
dhallam wrote:Does the validation scenario pick up changes to the Java code in the current project dynamically, e.g. change the interface of a java method and all of a sudden the XPath in the XSL is invalid?
Yes. You can set as extension in the scenario the folder containing the Java class files. When the Java files are recompiled the new class files are used in the next validation action.


Regards,
Sorin
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

Many thanks for your reply.

I've tried to add a Validation scenario but I can't add extension URLs to any Engine Types except the Intel XML Software Suite. I want to use Saxon.

Any ideas?

Many thanks again
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

Forgot to say, the Extensions(0) button is grayed out and disabled.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by sorin_ristache »

The problem was fixed in later versions. For example in the current version (10.2) an extension can be set in a validation scenario. Did you purchase a Maintenance Pack with your Oxygen license so that you can upgrade to versions 10.x? Please send some details about your Oxygen license purchase (purchase ID, registration name, the license key, etc) and we will find a solution.


Regards,
Sorin
SreeOne
Posts: 2
Joined: Thu Aug 27, 2009 5:05 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by SreeOne »

Hi Sorin,
I am Mr Sree from Cisco Systems.
I just ran into this Saxon extension red lines issue in my Oxygen plugin for Eclipse. Your responses are helpful.
Could you please help me to upgrade my Eclipse plug-in to the version with these fixes?
I will send you the details of our license in a private email to you
(do you mind sharing your email ID with me?)
Thanks,
Sree
sorin wrote:The problem was fixed in later versions. For example in the current version (10.2) an extension can be set in a validation scenario. Did you purchase a Maintenance Pack with your Oxygen license so that you can upgrade to versions 10.x? Please send some details about your Oxygen license purchase (purchase ID, registration name, the license key, etc) and we will find a solution.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by sorin_ristache »

Please send the details to the address that I sent you to see if you have a Maintenance Pack (or you purchased already an upgrade).


Regards,
Sorin
SreeOne
Posts: 2
Joined: Thu Aug 27, 2009 5:05 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by SreeOne »

Hi Sorin,
I just verified our current licensing.
It seems like our current license expired in Jan'09.
The person who is responsible to maintain these left the company and we are not aware of the upgrade.
I initiated a process to check for the possibility to upgrade our maintainance package.

Thanks
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

Hi,
In the current version the validation does not look for extensions in the Java projects that are currently opened in Eclipse. In a future version the validation will look for the Java extensions in the classpath of the opened Eclipse projects.
Has this been done yet - or is there a release scheduled for this? As the class that contains my extension function depends on other external class (e.g. Jakarta Commons), I'm having to manually add those JARs and their dependencies to the the Validation scenario. They are already declared as dependencies in the Java project.

Running Oxygen 12.1 as an eclipse plugin on WinXP in eclipse 3.6.1 with the m2 (Sonatype) Maven plugin.

Many thanks,

Dave
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by adrian »

Hello,

No, I'm afraid this hasn't been implemented yet. And there isn't a fixed release schedule for this feature either.
Do note that this feature refers to a very specific use case for a very specific platform and it requires significant effort to accommodate. As a result this has a very low priority.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
dhallam
Posts: 6
Joined: Wed Apr 29, 2009 5:07 pm

Re: Eclipse Plugin 9.3.0 custom Java ext fn errors

Post by dhallam »

No problem - just thought I'd ask. :)

Many thanks.
Post Reply