Using version 2.0.1, my xsl transformer worked fine, but when I upgraded to
version 2.1, I get the following error:
SystemId Unknown; Line 1; Column 7; Wed Jun 13 16:41:14 GMT+10:00 2001:
TransformerConfigurationException: stylesheet requires attribute: version;
Missing or incorrect XSLT Namespace.
All my stylesheets start with:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
And my transformer follows the following syntax:
try{
xmlSource = new StreamSource(strrdXml);
xslSource = new StreamSource(xslLocation.openStream());
TransformerFactory tFactory = TransformerFactory.newInstance();
tFactory.setURIResolver(sur);
transformer = tFactory.newTransformer(xslSource);
if(parameters!=null){
for(int i=0;i<parameters.length;i++){
String pair = parameters[i];
String parmName = pair.substring(0,pair.indexOf("="));
String parmValue = pair.substring(pair.indexOf("=")+1,pair.length());
transformer.setParameter(parmName,parmValue);
}
}
transformer.transform(xmlSource, new StreamResult(out));
} catch(TransformerConfigurationException te){
DebugListener.printOut("TransformerConfigurationException:
"+te.getMessageAndLocation());
} catch(Exception e){
DebugListener.printOut("XslProcessor: "+e);
}
I can't seem to locate any info on why this is happening, as Line 1 column 7
is the character 'y' in stylesheet.
Anyone able to help me on this one?
Cheers,
Anthony Ikeda
Web Application Developer,
Proxima Technology Pty. Ltd.
North Sydney
New South Wales,
Australia 2060
Office: (612) 9458 1718
Mobile: 041 624 5143