|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Detailed XSL Transform Node Stack Trace |
« View previous topic :: View next topic » |
Author |
Message
|
lancelotlinc |
Posted: Mon Sep 16, 2013 5:37 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
"No se ha podido compilar la hoja de estilos" == "Could not compile stylesheet"
What about the children stylesheets ? Are they present and do they validate ? _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Urizen |
Posted: Mon Sep 16, 2013 5:41 am Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
I'll give it a try and let you know what happens, thanks!!. |
|
Back to top |
|
 |
Urizen |
Posted: Mon Sep 16, 2013 5:43 am Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Quote: |
"No se ha podido compilar la hoja de estilos" == "Could not compile stylesheet"
|
Exactly.
Quote: |
What about the children stylesheets ? Are they present and do they validate ?
|
Yes, they are all present and validate.
I'll try the classloader trace and, after the tests, let you know what happens. |
|
Back to top |
|
 |
Urizen |
Posted: Mon Sep 16, 2013 7:32 am Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Hi,
After all it was not a problem of class loading, it seems that Broker does not accept calling non-static java methods when using Xalan...
I'll explain it in a few lines.
Works fine:
Code: |
public class Test {
public static String method() {
return "Hello World!!";
}
}
<xsl:value-of select="test-utils:method()"/>
|
Does not work:
Code: |
public class Test {
public String method() {
return "Hello World!!";
}
}
<xsl:variable name="ti" select="test-utils:new()"/>
<xsl:value-of select="test-utils:method($ti)"/>
|
It's really strange, the behavior should be the same in both cases, but in the second one the execution fails with the message "Could not compile stylesheet". I'll try to do some more research in Broker and Xalan documentation.
In my case I can not use static methods... If I find a solution, I'll write it here.
Thanks all. |
|
Back to top |
|
 |
Urizen |
Posted: Tue Sep 17, 2013 4:40 am Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Hi again...
I was wrong in my last post, it's not a problem of non-static methods, it's a problem with interfaces... when you have a factory class that returns an interface instead of a class, the transformation fails, pretty strange, uh?.
When you use the following stylesheet the first implementation of the factory class works fine, and the second one fails with the "Could not compile stylesheet" message... really crazy, and pretty hard to find out considering that the logs and traces are not full detailed when using Java and XSLT Transform Node.
Stylesheet
Code: |
<xsl:template match="/">
<xalanExtensionFunctionsTest>
<xsl:variable name="translationUtilsInstance" select="translation-utils-factory:getTranslationUtilsInstance()"/>
<nonStaticTranslationUtilsMethod>
<xsl:value-of select="translation-utils:nonStaticMethod($translationUtilsInstance)"/>
</nonStaticTranslationUtilsMethod>
</xalanExtensionFunctionsTest>
</xsl:template>
|
Implementation that works:
Code: |
public class TranslationUtilsFactory {
public static XalanTranslationUtils getTranslationUtilsInstance() {
retun new XalanTranslationUtils();
}
}
|
Implementation that fails:
Code: |
public class TranslationUtilsFactory {
public static ITranslationUtils getTranslationUtilsInstance() {
retun new XalanTranslationUtils();
}
}
|
Note the return type of the factory class: even when the real instance is the same in both cases, it seems that when you declare the interface as the return type everything goes crazy and the tranformation fails. |
|
Back to top |
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|