Home » Software Development

Getting XMLSpy to support EXSLT dynamic functions

Submitted by on October 12, 2005 – 4:08 pm 1,082 views 4 Comments

Recently I have been using XSLT to transform XML from one format to the other. I use Xalan (for Java) in the application itself, but often develop and debug with XMLSpy. I needed a way for XSLT to dynamically evaluate and select a given string, and found no easy way to do this other than the EXSLT dyn extentions.

After implementing the evalute() function, I quickly discovered that neither the default XMLSpy XSLT engine, nor MSXML recognize it. So, after a few fruitless attempts I finally decided to use the same engine that I’m using in the Java application. I simply needed to go under Tools -> Options -> XSL, then select External XSL Transformation Program.

Input:

java -cp XALAN_PATH\xalan.jar org.apache.xalan.xslt.Process -in %1 -xsl %3 -out %2

Now everything transforms as expected!

Post to Twitter Post to Delicious

4 Comments »

  • Pietro says:

    OK, and when we get a ClassNotFound Exception, how can we install the class and from which source?

    Do we need a standalone installation of Xalan into the Java environment?

    Thanks!

  • ericblue76 says:

    It’s been a while since I wrote this post, so the version of the Xalan .jar I used was from 2005. I doubt the class names have changed, so I would first recommend that you very executing the statement:

    java -cp XALAN_PATH\xalan.jar org.apache.xalan.xslt.Process -in %1 -xsl %3 -out %2

    from the command line first. Of course, replace XALAN_PATH with the actual location on your hard drive (e.g. c:\java\libs\xalan.jar). And, make %1 your source file, %3 your .xsl file, and %2 your desired output file.

  • Dan says:

    This works fine for me:
    java -classpath c:\work\xalan-j_2_7_1\xalan.jar org.apache.xalan.xslt.Process -IN %1 -XSL %3 -OUT %2

  • Jens says:

    Solution works for me (only with additional brackets):

    java -cp “C:\Program Files (x86)\xalan-j_2_7_1\xalan.jar” org.apache.xalan.xslt.Process -in %1 -xsl %3 -out %2

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.