Main hurdles when migrating from XSLT 1.0 to XSLT 2.0


I am about to lead a migration from XSLT 1.0 to XSLT 2.0 for my company. We have a large number of XSLs that transform XMLs into HTML, and manny other "flat file" (i.e., non-HTML, no-layout) formats. I would very much like to know what the main obstacles are when doing such a migration, especially if there is someone here who has done that migration him/herself.

So: What are the main principal differences? What are the main obstacles? And are there other good advice and recommendations?

(I know that this question is a kind of open question, I will award the points to the best recommendation/s.)

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gertone (Geert Bormans)Information ArchitectCommented:
there is a good tutorial on IBM worx, I will trace it back and show you in a minute

I have done tons of migrations from XSLT1 and XSLT2 and for me the trickiest bit is type casting.
XSLT1 does automatic casting of types and XSLT2 does not in many cases... this could lead to unexpected results.
I will come back in a minute with some good references
Gertone (Geert Bormans)Information ArchitectCommented:
Gertone (Geert Bormans)Information ArchitectCommented:
The third in the series has some usefull hints
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Gertone (Geert Bormans)Information ArchitectCommented:
I can imagine that you don't feel like reading through seven extensive articles (no matter how good the quality is)

- If possible make some regression tests (I always set a bunch of files aside, preferably with some exceptions in it). Then I run the transforms over the set, so I have some anchor points to compare with

- change the version attribute from 1.0 to 2.0

- validate , remove the errors

- run, and again remove the errors (most likely these will be type casting errors)

- now you should have a running transform. You can now check the result set against the regression set

- start taking advantage of XSLT2 features to pump up performance, get rid of extensions that made it to the main language (eg. exslt:node-set() )
Start benefiting from the date types to throw out all you string processing to emulate date processing, replace all your string-replacing recursive functionality with regex functionality

... and with every change, compare to the regression set
Gertone (Geert Bormans)Information ArchitectCommented:
if you weren't already doing so...
you could start by running a XSLT2 processor on the XSLT1 stylesheet
It will raise some warnings already

Please also evaluate carefully your extension functions, if you have them
you might see them break on the new processor

From what processor are you moving to what processor?
thecosimistAuthor Commented:
Wow, great comments. Thanks. I will look up the processor we're moving from tomorrow and get back immediately.

I will definitely read the articles, I will spend the coming days working on this, so thanks again.

thecosimistAuthor Commented:
Hi again,

We are using Xalan in a Java 1.5 environment. I have the impression that we will have to move to Saxon since Xalan as of now lacks XSLT 2.0 and XPath 2.0 support. Is that correct? AQre there other better Java alternatives?
Gertone (Geert Bormans)Information ArchitectCommented:
honestly? Saxon is the "only" alternative.
The one from XML Spy has too much performance problems and some stuff that is not correct regarding the standard
and Gstalt is getting too little noise these days, so I am afraid there is no evolution there
Some vendors are now working towards a XSLT2 processor, but really Saxon is currently the only real production ready alternative.

I strongly suggest that you look into the PE or EE line of products, because there are some hidden optimisations compared to the free edition

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thecosimistAuthor Commented:
THANKS for extremely helpful comments, recommendations, and info links. These answers on their own are worth the experts-exchange yearly account. You have saved me many days of research and probably a large number of mistakes :-)

Gertone (Geert Bormans)Information ArchitectCommented:
you are very welcome, good luck with the migrations.
If you bump into an issue, don't hesitate to come back here
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.