XSL 1.0/2.0+ usage on XPP

We are having problems maintaining the old "C++" version  of the program "Xalan" for XSL 1.0  processing. This program is triggered through "xychange" when the command line does NOT contain the "-xsl2" option, as we use the default behavior to preserve XSL 1.0 processing.  Since it is a program, it can also be used in scripting by calling "Xalan" directly. In my opinion, no one should be using XSL 1.0 at this point since it is has been far exceeded by 2.0/3.0 with very awkward work arounds for very common transformations and other transformations that are just not possible. The functionality has been replaced by the program "xppxslt",  which uses the Saxon parser, but requires Java.  Saxon is upwards compatible and XSL 1.0 transforms will run as is.

If you are doing XSL processing on XPP, I would like to know:

1. Are you installing Java and running with XSL 2.0+ functionality?

2. Are you calling the program "Xalan" directly in your scripts

3. Can XPP change the requirements to state that you need Java if you are doing any XSL processing at all?

With this in mind, in a future release we would:

1. Stop delivering "Xalan", but leave it on any system so custom scripts would still function.

2. Change "xychange" to automatically use the xppxslt/Saxon processor with or without the "-xslt2" option.

3. Change the requirements documentation to state that Java is required if doing any XSL processing. NOTE: Java is already required if using SVG or the 'xppcompare' program.

Thanks

Steve Piercey

RWS/SDL/XyEnterprise/Xyvision

  • Steve,

    Your timing is excellent as today I am just extending a very old production script that was created by the now defunct Portalyx. This script has been created in 2005 and is still at the heart of production at Maruboshi in Holland. There is a part of the script that is preprocessing the xml running 2 Xalan based XSLT steps of which I have no idea what they are doing and even no desire to know what they are doing (I am just the maintainer that makes sure everything keeps running and from time to time extends/adapts the script). So Xalan is still in use and in this case called directly. 

    Now to answer your questions one by one:

    1. Are you installing Java and running with XSL 2.0+ functionality?
    At every installation/upgrade I do, I make sure the Java run time is installed and the the XSLT2 engine is running.
    All the XSLT's we currently make are XSLTV2. Simply because the XSLTV2 engine is a lot faster than the V1 engine

    2. Are you calling the program "Xalan" directly in your scripts
    Well in this one particular case mentioned above: yes, but that is an exceptional case that I inherited
    I would be amazed if over time I ever created something else that would call xalan directly...but never say never

    3. Can XPP change the requirements to state that you need Java if you are doing any XSL processing at all?
    If you ask me: most certain

    With this in mind, in a future release we would:

    1. Stop delivering "Xalan", but leave it on any system so custom scripts would still function (and xychange continues to work as before).
    That is OK as long as you don't remove the existing Xalan from the system.
    Later added:
    Plus ' modify' xychange that if it finds the Xalan engine, it continues to use the Xalan engine for V1 stylesheets. (this to avoid unexpected changes that could occur when the V2 engine is always used)

    2. Change "xychange" to automatically use the xppxslt/Saxon processor with or without the "-xslt2" option.

    That is OK as well. I am assuming that you will run Saxon with the -versionmsg:off option (just like you do now?) so we will not see any of the warnings when you run an XSLT1 stylesheet with an XSLT2 engine.
    I am assuming also that you have been running enough test to see if the resulting XML files are any different. I think in most cases the result would be the same but you never know that there is some obscure stylesheet out there that produces a slightly different result that might upset something else futher downstream

    3. Change the requirements documentation to state that Java is required if doing any XSL processing. NOTE: Java is already required if using SVG or the 'xppcompare' program.

    I even think that it is best to just add the installation of a java run time engine to the prerequisites to installing an XPP server.
    (How does a sys admin ever know that sooner or later nobody is going to run XSLT2 or xppcompare or SVG image conversion on the XPP system???)
    Having it as a prerequisite will prevent a lot of wasted time later on when a poor user is trying any of the above.

  • We agree with Bart but we have a question: If you "leave as is" on existing systems but remove this from the install for new installs what happens when a user wants to upgrade their server. Traditionally the users would do a clean install and therefore would lose the Xalan in that scenario.

  • Chris,

    When you say "upgrade their server", you are referring to either an O/S upgrade or a hardware upgrade, correct?
    Because typically an XPP upgrade, you just do on top of the existing installation.

    I guess that in the case of an O/S or hardware upgrade, you will have to move over the xalan.exe + the .dll files manually.
    If I am not mistaken that would be:

    • Xalan.exe
    • Xalan-C_1_11.dll
    • Xalanmessages_1_11.dll
    • xerces-c_3_2.dll

    Maybe Steve can confirm that this is what is needed to move over Xalan from your old server to your new server

  • That is definitely what I was trying to say! If the above is true then that needs adding to the installation documentation.

  • Steve,

    Just an additional thought to my earlier anser...

    Could Xychange be made clever enough that if Xalan is found on the system, it would continue to use Xalan for the XSLTV1 stylesheets?
    Like that existing users will be able to sleep at night and do not have to worry about unexpected differences popping up in their transformation chains.

    I think it is very important that existing xpp transformations must continue to use the same XSLT engine as they have always done.

    In theory running an XSLT V1 stylesheet with a V2 engine should give you the same result, but we (Tine and me) have found at least 1 case where this is not the case.
    In this particular instance the V1 engine had been running without a problem for years. But wanting to speed things up, we forced xychange to use the V2 engine. That resulted in a fatal error and no output at all.
    (hey, I even found the files and stylesheets in question - can send them to you Steve or if you prefer that I open up a ticket that can be done as well - just let me know)

    The error that the V2 engine gave was:

    Pass 1, Transformation table: c:\Temp\xxx.xsl
    Static error at xsl:sort on line 2218 column 36 of xxx.xsl:
      XTSE0010: Within xsl:for-each, xsl:sort elements must come before other instructions
    Errors were reported during stylesheet compilation
    Error: Cannot create file C:/Temp/out.xml

    This was due to the following construct in the xslt:

     <xsl:for-each select="...">
    	<xsl:variable name="pridnbr">
    		<xsl:value-of select="@pridnbr"/>
    	</xsl:variable>
    ->	<xsl:sort order="ascending"/>
    

    This needed to be changed as follows in order to run on the V2 engine:

     <xsl:for-each select="...">
    ->	<xsl:sort order="ascending"/>
    	<xsl:variable name="pridnbr">
    		<xsl:value-of select="@pridnbr"/>
    	</xsl:variable>
    

    Not a big deal but still could be the cause of a complete production stop and some very angry users on the phone...

    I edited my earlier answer to reflect this.


    Bart

    PS: love your signature

  • Yes, it would be possible to test for the existence of "Xalan" and use it if we find it on the system.

  • In that case I have no objections at all.

    If you can just confirm that my list of what is needed to transport Xalan to another system is complete (and maybe as Chris suggested add that info to the installation/upgrade instructions)...

  • yes, we would do that. This is not for XPP 9.5, its for the future. The list of files would be provided at that time. It is also different depending on whether you are on Linux/Windows.

    But Chris is correct for at least the base names of the files on Windows

    1. Are you installing Java and running with XSL 2.0 functionality?

          We have Java Installed but Do NOT use XSL 2.0 functionality.

           All XSL uses <?xml version="1.0" encoding="UTF-8"?>

    1. Are you calling the program "Xalan" directly in your scripts

          We are not calling Xalan in any scripts

    1. Can XPP change the requirements to state that you need Java if you are doing any XSL processing at all?

           YES

    --Jaye Mize

    Director, Content Production Systems

    JAMA NetworkTm

    330 N Wabash Ave, Ste 39300, Chicago, IL 60611

    T 312-464-4712  M 719-431-2462

    jamanetwork.com