You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2002/06/11 19:15:35 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/trax TemplatesHandlerImpl.java
santiagopg 2002/06/11 10:15:34
Modified: java/src/org/apache/xalan/xsltc/trax
TemplatesHandlerImpl.java
Log:
Fixed getTemplates() to return null when compilation fails.
Revision Changes Path
1.9 +18 -18 xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java
Index: TemplatesHandlerImpl.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesHandlerImpl.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TemplatesHandlerImpl.java 28 May 2002 19:35:26 -0000 1.8
+++ TemplatesHandlerImpl.java 11 Jun 2002 17:15:34 -0000 1.9
@@ -133,51 +133,51 @@
*/
public Templates getTemplates() {
try {
-
final XSLTC xsltc = getXSLTC();
// Set the translet class name if not already set
String transletName = TransformerFactoryImpl._defaultTransletName;
- if (_systemId != null) transletName = Util.baseName(_systemId);
+ if (_systemId != null) {
+ transletName = Util.baseName(_systemId);
+ }
xsltc.setClassName(transletName);
- // get java-legal class name from XSLTC module
+
+ // Get java-legal class name from XSLTC module
transletName = xsltc.getClassName();
Stylesheet stylesheet = null;
SyntaxTreeNode root = getDocumentRoot();
// Compile the translet - this is where the work is done!
- if ((!errorsFound()) && (root != null)) {
+ if (!errorsFound() && root != null) {
// Create a Stylesheet element from the root node
stylesheet = makeStylesheet(root);
stylesheet.setSystemId(_systemId);
stylesheet.setParentStylesheet(null);
setCurrentStylesheet(stylesheet);
- // Create AST under the Stylesheet element (parse & type-check)
+ // Create AST under the Stylesheet element
createAST(stylesheet);
}
// Generate the bytecodes and output the translet class(es)
- if ((!errorsFound()) && (stylesheet != null)) {
+ if (!errorsFound() && stylesheet != null) {
stylesheet.setMultiDocument(xsltc.isMultiDocument());
stylesheet.translate();
}
- xsltc.printWarnings();
-
- // Check that the transformation went well before returning
- final byte[][] bytecodes = xsltc.getBytecodes();
- if (bytecodes == null) {
- xsltc.printErrors();
- return null;
+ if (!errorsFound()) {
+ // Check that the transformation went well before returning
+ final byte[][] bytecodes = xsltc.getBytecodes();
+ if (bytecodes != null) {
+ return new TemplatesImpl(xsltc.getBytecodes(), transletName,
+ _experimentalOutput);
+ }
}
-
- return new TemplatesImpl(bytecodes, transletName,
- _experimentalOutput);
}
catch (CompilerException e) {
- return null;
+ // falls through
}
+ return null;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org