Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while upgrading from XSLT 1.0 to XSLT 2.0

 
Abhijith Prabhakar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on up gradation of XSLT 1.0 to XSLT 2.0 in JAVA. We are using xercesimpl jar for conversion.

In xslt 1.0 I was creating a variable with complex data type. For example,

and was accessing it by using:
<xsl:value-of select="xalan:node-set($empDetails/NAME)" />

Since in XSLT 2.0 RTF's have been removed I am trying to accessing the node directly
<xsl:value-of select="$empDetails/NAME" />

It gives an error while trying to access like above. In xslt debugger it doesn't give much information. It just says.
org.apache.xpath.objects.XRTreeFrag - org.apache.xpath.objects.XRTreeFrag

When I looked into logs of application I found:

Caused by: javax.xml.transform.TransformerException: java.lang.RuntimeException: Invalid conversion from 'com.sun.org.apache.xalan.internal.xsltc.dom.SAXImpl' to 'node-set'.
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:647)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
Can someone please let me know how to solve this issue?
 
Paul Clapham
Sheriff
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the software components you are using support XSLT 2.0, and which don't support it?
 
Abhijith Prabhakar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using below schema definitions:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan-j" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:cal="xalan-j://java.util.GregorianCalendar">

I am using xalan-j 2.7.1 jars for generating output(in turn xercesimpl 2.9.2)
 
Paul Clapham
Sheriff
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijith Prabhakar wrote:I am using xalan-j 2.7.1 jars for generating output(in turn xercesimpl 2.9.2)


Which of those two components supports XSLT 2.0?
 
Abhijith Prabhakar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thanks paul, I researched through the net and found that none of these component support xslt 2.0 . Found that only free source which supports xslt 2.0 is Saxon right now. Our team will decide to move on to saxon from xalan or not.

You can find that discussion here

Thanks a lot!!!

Regards,
Abhijith P
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic