Re: [xsl] Errors with JAXP

Subject: Re: [xsl] Errors with JAXP
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Wed, 5 Mar 2008 13:03:55 +0000
On 05/03/2008, igutierrez027@xxxxxxxxxxxxx <igutierrez027@xxxxxxxxxxxxx> wrote:
>  I am using JAXP to execute XSLT 2.0.

JAXP was considered OT the other day...


>  ERROR:  'Unsupported XSL
>  element 'http://www.w3.org/1999/XSL/Transform:next-match''
>
>  For the SECOND OPTION of template:
>
>  ERROR:  'Error of sintaxis in '$x/(.,following-sibling::node())'.'

Both are XSLT 2.0 techniques so it's most likely you are using an XSLT
1.0 processor when running the transform using JAXP.

When you do:

TransformFactory.newInstance()

...you'll get the first TransformFactory found on the classpath.

To specify to use Saxon regardless of the ordering of the classpath, use:

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

You can set the propery either internally or externally so its easy to
swap in a different JAXP compliant processor at a later date.

If you're happy to have compile time references to Saxon, then just do:

new net.sf.saxon.TransformerFactoryImpl()

Of course Saxon needs to be on the classpath in the first place...
which could be your problem at the moment.

cheers
-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread