list4xt : Mailing list for the XT users community.
[list4xt] HDMLOutputHandler throws NullPointer exception when used with Out putStreamDestination
Subject: [list4xt] HDMLOutputHandler throws NullPointer exception when used with Out putStreamDestination
User: Website From: Mahesh Zambani (Mzambani@go2online.com)
Date: 06/02/2001 - 21:59
Hi,
I am using HDMLOutputHandler to convert from XMl to HDML. Everything
works fine until I use XT from Java and use OutputStreamDestination as
destination, and it throws NullPointerException.
** Here is the java code fragment **
XSLProcessorImpl xsl = new XSLProcessorImpl();
...
xsl.setErrorHandler(new ErrorHandlerImpl());
OutputMethodHandlerImpl outputMethodHandler = new
OutputMethodHandlerImpl(xsl);
xsl.setOutputMethodHandler(outputMethodHandler);
InputSource in = new InputSource( new StringReader(inputXMLString)
);
InputSource stylesheet = new InputSource(xslURL);
Destination out = new OutputStreamDestination( new
ByteArrayOutputStream() );
outputMethodHandler.setDestination(out);
xsl.loadStylesheet(stylesheetSource);
xsl.parse(inputSource);
//return string
return new String (out.getOutputStream("","").toString() );
** identity.xsl **
<?xml version="1.0" encoding='iso-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xt="http://www.jclark.com/xt">
<xsl:output method="java:HDMLOutputHandler"
xmlns:java="http://www.jclark.com/xt/java"/>
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Thanks in advance.
Mahesh Zambani
Principal Engineer
Go2Online.com
mzambani@go2online.com
--
Mailing list for the XT users community. (http://financemom.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
Archive générée par hypermail 2b28 le 25/04/2001 - 07:16 CEST
webmaster@4xt.org
|