Thanks, Mike.
I have not used servlets or JAXP at all and have hardly done any programming
in Java, so it might take me a while to figure out the solution you've
proposed. Meanwhile, I decided to eliminate the parameters passed as
command-line arguments to Saxon so as to transform the XML into HTML in the
browser itself. When I tried doing so, I get the following error:
"Error during XSLT transformation: XSLT transformation failed."
I have tested the XSLT and am sure it works; and I have been able to use the
browser to do the transformation with the previous version of this XSLT I
had. The main (and am sure important) difference with this XSLT is it is
conformant to XSLT 2.0 standards while the previous one was conformant to
XSLT 1.0. That is, I am using for-each-group now instead of for-each loops
and this is probably what's causing the error (my guess). Is this the
source of the problem or is it something else? Please advise.
Thanks,
Bhaskar
----Original Message Follows----
From: "Michael Kay" <mike(_at_)saxonica(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: RE: [xsl] Calling Saxon from a CGI script
Date: Wed, 20 Jun 2007 09:17:20 +0100
> I am using the Saxon processor for java to transform an XML
> into HTML. The XSL expects the user to provide two parameter
> values as command line arguments to Saxon. So, my call to
> Saxon is something like this:
> >java net.sf.saxon.Transform -o report.html report.xml report.xsl
> >param1=val1 param2=val2
>
> The values val1 and val2 are inputs in an HTML form and would
> be available at run-time in a CGI perl script. Once I get
> these values, I basically want to call Saxon as above to
> perform the transformation. I am trying to use the 'system'
> command inside the CGI perl script
You really don't want to do it that way. Loading and initializing a Java VM
just to run one transformation is not the way to do things in a web service
environment. (It can take 5 seconds to load the VM to run a 50ms
transformation.) Write a Java servlet that runs in a container such as
Tomcat which keeps the VM alive, and use the JAXP API to drive the
transformations. There's a "starter kit" servlet for doing this in the Saxon
distribution.
> but it doesn't work - I am
> seeing the following error in the webserver error logs:
>
> *** glibc detected *** java: free(): invalid pointer: 0xbfc7cbb8 ***,
Sorry, that's not an XSLT or Saxon problem, it's something to do with the
configuration of your web server.
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
_________________________________________________________________
Catch all the cricketing action right here. Live score, match reports,
photos et al. http://content.msn.co.in/Sports/Cricket/Default.aspx
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--