XSLT parser throws SAX exception after upgrade from v4.0.2 to v4.0.5
 Technote (FAQ)
 
Problem
Upgrade of WebSphere® Application server from version v4.0.2 to v4.0.5 can cause problems with code written with the compatibility API. Since the compatibility API is deprecated, code should be changed to use the TrAX API.

Sample of lines in the sample code:

try
{

if (xml != null)
{
XSLTParser parser = new XSLTParser();
htmlOut = parser.transformUsingFile(xslTemplate, xml);

}
}

catch (XSLTParserException e)
{
outMsg.append("Error at XML Parser: " + e.toString());
System.err.println("Error at XML parser: " + e.toString());
}

Were replaced with:


TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer(new
StreamSource("xmlfile.xsl"));
StreamSource inputDocument = new StreamSource(new
StringReader(xml));

transformer.transform(inputDocument, new
StreamResult(System.out));
 
Cause
Deprecated compatibility API problems after upgrading to 4.0.5 from previous versions.
 
Solution
Changed code to use TrAX API
 
Related information
Xalan/Xerces Open Source WebSite
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers WebSphere Application Server Web Services Multi-Platform 4.0.2, 4.0.3, 4.0.4, 4.0.5 Advanced
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Web Services (for example: SOAP or UDDI or WSGW or WSIF)
Operating system(s): HP-UX
Software version: 4.0.5
Software edition:
Reference #: 1113437
IBM Group: Software Group
Modified date: Nov 30, 2004