Subjects
Home
Xalan extension functions
Fomatting question serializing DOM with pretty print
xalan with pull parser
Cannot find the declaration
Apache Xalan drop support to run on JRE 1 1 x
Why does Doctype change processing of a document
Node set to XML string via Java extensions in Xalan J: possible?
Templates/Transformers + thread safety???
Problem evaluating xpath with muliple prefix with different namespace
remove an arbitrary attribute from xsl output
Xalan3 XSLT 2 0 XPath 2 0 support?
Problem using compiled translets with Xalan !!
Xalan and jstl 1 1 problem with transform tag
NullPointer in DOM2DTM getLocalName
URIResolvers base parameter with xsltc and cascaded imports
Performance problem for Xalan J on intel dual core
Standard libraries in JAXP?
Serializing a DOM tree to XML file, customize entities replacement
Library Conflict Involving BCEL Library
A question on how users are using <xsl:message >
Kevin Cormier as a new Apache Xalan J committer
Struggling to iterate over tokenized string
Xalan count() trouble
Problem with recursive xpath
Error when switching to java 1 5
document( ' ')
Problem with Xalan2 7 0 transformation
cr/lf options
entity encoded XML
can xalan transform 2 xml using one xslt?
Xalan J JIRA defect review Monday October 16, 2006 from 2:00 to 3:30 pm ED
xsl transform with cdata section elements
xslt parameters not expanded
Weird behavior of XPath evaluate()
How to avoid <xsl:message > instruction prints stylesheet file informations ?
Cannot find SimpleTransform subdirectory after installing Xalan J
recover from document not found exceptions
jdk1 5 and Xalan jar differences?
Performance Issue
Error/Bug adding floating point numbers
XPathAPI: eval exp using nodes with default namespace
modifying xalan to output invalid XML
NullPointerException
mege two separate xml nodes into one
Is this a XALAN document identification bug?
is StylesheetRoot really java io Serializable ?
transform() fails for DOMSource but succeeds for StreamSource
Thoughts on Transformer parameter passing
HELP, Xalan and jstl 1 1 problem with transformer
Problem with XPath namespace axis?
string utils:replace deleting search string if replacement string is an HTML
help with enumeration values pls
xalan 2 5 1 vs 2 7 performance question
How to insert/update in XML document
HTML Serialization and Handling of Ampersands in HREF Attributes
XHTML link tag stripping
SystemId Unknown; Line #24; Column #49; java lang NullPointerException
xpath text() help
Apostrophe problem with xalan 2 7 0
How to set variables in XML document?
Links
Home
Oracle database error code ...
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Chaining Transformation

Chaining Transformation

2003-06-23       - By Schwartz, Rechell R, ALABS

I have been doing a lot of reading about how to chain transformations with SAX.
I attempted to execute the following code from a JSP page, and have printed the
exception that follows after the last line of code is executed. Does anyone
have any idea what is wrong?

Rechell Schwartz

String xsl1 = "data.xsl";
String xsl2 = "format.xsl";
           long sttime = System.currentTimeMillis();
      // Read the arguments
      File stylesheet1 = new File(xsl1);
      File stylesheet2 = new File(xsl2);

      // Set up the input stream
      InputSource input = new InputSource(new StringReader(hand.detailresult));

      // Set up to read the input file
      /* SAXParserFactory spf = SAXParserFactory.newInstance();
      spf.setNamespaceAware(true);
      SAXParser parser = spf.newSAXParser();
      XMLReader reader = parser.getXMLReader();

      // Create the filters  
      SAXTransformerFactory stf =(SAXTransformerFactory) TransformerFactory
.newInstance();
      XMLFilter filter1 = stf.newXMLFilter(new StreamSource(stylesheet1));
      XMLFilter filter2 = stf.newXMLFilter(new StreamSource(stylesheet2));

      // Wire the output of the reader to filter1 (see Note #3)
      // and the output of filter1 to filter2
      filter1.setParent(reader);
      filter2.setParent(filter1);

      // Set up the output stream
      StreamResult result = new StreamResult(out);

      // Set up the transformer to process the SAX events generated
      // by the last filter in the chain
      Transformer transformer = stf.newTransformer();
      transformer.setParameter("flash", flashText);
      transformer.setParameter("noflash", noflashText);
      transformer.setParameter("sitename", site_name);
      SAXSource transformSource = new SAXSource(filter2, input);
      transformer.transform(transformSource, result);


-------------------------------------------------------------------------------
-------
000000> <javax.xml.transform.TransformerException: java.lang
.NullPointerException
       at weblogic.apache.xalan.transformer.TransformerIdentityImpl.transform
(TransformerIdentityImpl.java:462
)
       at jsp_servlet._maint.__data._jspService(__data.java:280)
       at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
       at weblogic.servlet.internal.ServletStubImpl.invokeServlet
(ServletStubImpl.java:265)
       at weblogic.servlet.internal.ServletStubImpl.invokeServlet
(ServletStubImpl.java:200)
       at weblogic.servlet.internal.WebAppServletContext.invokeServlet
(WebAppServletContext.java:2495)
       at weblogic.servlet.internal.ServletRequestImpl.execute
(ServletRequestImpl.java:2204)
       at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
       at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
---------
java.lang.NullPointerException
       at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:980)
       at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:125)
       at weblogic.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java
:130)
       at weblogic.apache.xalan.transformer.TrAXFilter.parse(TrAXFilter.java
:130)
       at weblogic.apache.xalan.transformer.TransformerIdentityImpl.transform
(TransformerIdentityImpl.java:445
)