[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Got it working (using Saxon-HE 11_5 was Re: Migrat

Subject: Re: Got it working (using Saxon-HE 11_5 was Re: Migrating XSLT (2.0) from appliance to Java?
From: "Christophe Marchand cmarchand@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 22 Aug 2023 15:48:43 -0000
Re:  Got it working (using Saxon-HE 11_5 was Re: Migrat
Your appliance probably uses Saxon behind the woods...

For such a simple thing, you'd probably be able to use directly Saxon 
command line : 
https://saxonica.com/documentation11/index.html#!using-xsl/commandline

Christophe


Le 22/08/2023 C  16:51, ohaya ohaya@xxxxxxxxx a C)critB :
> Hi,
>
> FYI, I was able to use the almost same Java code with Saxon-HE 11_5 
> and got the XSLT working.
>
> I had to add a line to the Java code to set the system property:
>
> System.setProperty("javax.xml.transform.TransformerFactory", 
> "net.sf.saxon.TransformerFactoryImpl");
>
> and on the javac and java command liknes add the JARs to the class 
> path, e.g.:
>
> java -cp 
> ./:saxon-he-11.5.jar:jline-2.14.6.jar:xmlresolver-4.6.4-data.jar:xmlresolver-4.6.4.jar 
> Main X.xml X.xsl
>
> I was pleasantly surprised that the XSLT worked exactly as it did when 
> I used it on the gateway appliance!!
>
> Jim
>
>
> On Tuesday, August 22, 2023 at 08:22:07 AM EDT, ohaya 
> <ohaya@xxxxxxxxx> wrote:
>
>
> Hi,
>
> My apologies - I accidentally clicked "Send" before I had added my 
> text :( !!
>
> A while ago, (in February 2023), I had a thread where you all helped 
> me get an XSLT working.
>
> I think this was the thread in the archives:
>
> "Followup question: was Re:  XSLT to populate a SAML 
> AttributeStatement from an XML
>
> ohaya ohaya@xxxxxxxxx - 16 Feb 2023 14:51:32 -0000 "
>
> At that time, the XSLT was being used on a gateway appliance (a 
> Broadcom API Gateway), and after getting the XSLT work, we were put on 
> hold, but now they want to pick up where we left off, but instead of 
> the XSLT on the API Gateway, we need to use the XSLT on a Linux 
> machine, so I am trying to get it working with Java 1.8 now.
>
> This is the test Java app that I am trying to get working:
>
> =========================================================
>
> // Example from 
> http://www.java2s.com/Tutorials/Java/Java_XML/0200__Java_XSLT_Intro.htm
> //
> import javax.xml.transform.Transformer;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.stream.StreamResult;
> import javax.xml.transform.stream.StreamSource;
>
>
> public class Main {
>
> public static void main(String args[]) throws Exception {
> StreamSource source = new StreamSource(args[0]);
> StreamSource stylesource = new StreamSource(args[1]);
>
> TransformerFactory factory = TransformerFactory.newInstance();
> Transformer transformer = factory.newTransformer(stylesource);
>
> StreamResult result = new StreamResult(System.out);
> transformer.transform(source, result);
> }
> }
>
> =========================================================
>
> When I try to run the XSLT that we ended up with back in February 
> 2023, I am getting an error:
>
> "[root@dlwoas01 jl]# java Main X.xml X.xsl
> ERROR: 'Could not compile stylesheet'
> FATAL ERROR: 'Error checking type of the expression 'funcall(tokenize, 
> [step("self", -1), literal-expr(:)])'.'
> :Error checking type of the expression 'funcall(tokenize, 
> [step("self", -1), literal-expr(:)])'.
> "
> I suspect/guess that the problem is that the Java 1.8 only supports 
> XSLT 1.0, but I don't know if it is allowable to ask about this type 
> of thing here in this list, so I wanted to ask that first?
>
> Thanks in advance!!
>
> Jim
>
>
>
>
> On Tuesday, August 22, 2023 at 08:08:19 AM EDT, ohaya 
> <ohaya@xxxxxxxxx> wrote:
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3515434> 
> (by email <>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.