Re: Runtime exception thrown while using XsltFilter in pipeline
Chris Burdess <[email protected]>
| Newsgroups | gmane.comp.java.classpath.extensions.xml |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Artur Matos wrote:
> I have just started using JAXP (GNU or otherwise), so
> first of all I am sorry if this is a rather basic
> question. I am trying to build a very simple pipeline
> with the gnu.xml.pipeline package: basically for
> reading an input XML file, processing it via XSLT, and
> displaying the transformation in the standard output.
> The problem is that my program always throws a
> java.lang.RuntimeException at the XSLT stage,
> something like this:
>
> Exception in thread "main" java.lang.RuntimeException
> at
> org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:
> 3407)
> at
> org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(Transfo
> rmerHandlerImpl.java:433)
> at
> gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:334)
> at
> gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294)
> at
> org.deriva.pipeliner.Pipeliner.main(Pipeliner.java:63)
>
> Both program and used files can be found at the end of
> this message. I have tried to change the XSLTFilter
> step for other stages and it works perfectly, so the
> problem should lie there. I have also tried with
> different SAXDrivers and XSLT processors -- Xerces,
> Xalan and SAXON -- and I always have the same problem.
> I have also tried to transform the document from the
> command line, with both xsltproc and the xalan command
> line utility and it works perfectly with both.
This does look very much like a problem in Xalan. Have you examined the
source for Xalan TransformerImpl?
You could also try with libxmlj. Set the system properties
javax.xml.parsers.SAXParserFactory=gnu.xml.libxmlj.sax.GnomeSAXParserFac
tory
javax.xml.parsers.TransformerFactory=gnu.xml.libxmlj.transform.GnomeTran
sformerFactory
and use the standard JAXP factory methods to obtain an XMLReader (via
SAXParserFactory) and Transformer.
- --
Chris Burdess
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFA+3036dl1DEqHgrgRAh6bAJ9Xs3kUTm/jln/pdvlrcOVILwa97wCfWkGw
qYi6xXRVAe9oXZrFLquZYzE=
=VPG4
-----END PGP SIGNATURE-----