Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

JAXP / Xalan / data-types problem

Thread view: 
Felix Engelhardt - 17 Apr 2006 15:17 GMT
Hi there,

I'm having a problem compiling an XSL-stylesheet using JAXP/Xalan which is
really driving me nuts...

When I try to compile a stylesheet that contains something like:

<xsl:value-of select="encode-for-uri(/bla)"/>

then I get a TransformerConfigurationException saying that there was an
error while checking the type of the expression "funcall(encode-for-uri
...)". I don't know the exact error message, as the message I get is in
German for some reason (literally it says "Fehler beim Überprüfen des Typs
des Ausdrucks").

I suppose that the reason for this is that encode-for-uri returns an
xs:string and @select expects a node-set, and it cannot convert between the
two.

If anybody knows how to solve this problem, please let me know, as I've
already spent a few hours on this and I'm really frustrated ;-).

Regards,

Felix
Felix Engelhardt - 18 Apr 2006 16:16 GMT
Found a solution:
The problem was that Xalan does not support XSLT 2.0 nor XPath 2.0 (though
it seems to support some of the 2.0 features and does not complain about the
stylesheet being declared as 2.0). So I just switched to Saxon. In order to
tell JAXP to use Saxon instead of Xalan for transformation, I just had to
insert the following line into my initialization code (and include the Saxon
libraries in my classpath, of course):

System.setProperty("javax.xml.transform.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");

Surprisingly, it was pretty hard to find this information on the web... The
Saxon documentation states that normally this shouldn't be necessary, but
obviously it was for my web app on Tomcat.

Best regards,

Felix


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.