Page 1 of 1
Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Wed Apr 29, 2009 5:17 pm
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.
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Wed Apr 29, 2009 5:57 pm
by sorin_ristache
Hello,
You have to specify your Java extensions in a
validation scenario associated with the validated XSLT stylesheet.
Regards,
Sorin
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Apr 30, 2009 12:54 am
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.
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Apr 30, 2009 12:14 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Apr 30, 2009 12:29 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Apr 30, 2009 12:30 pm
by dhallam
Forgot to say, the Extensions(0) button is grayed out and disabled.
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Apr 30, 2009 2:18 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Aug 27, 2009 5:09 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Aug 27, 2009 5:43 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Thu Aug 27, 2009 8:04 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Mon Feb 21, 2011 1:53 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Mon Feb 21, 2011 7:01 pm
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
Re: Eclipse Plugin 9.3.0 custom Java ext fn errors
Posted: Mon Feb 21, 2011 10:06 pm
by dhallam
No problem - just thought I'd ask.
Many thanks.