morten 01/10/30 23:29:39
Modified: java/src/org/apache/xalan/xsltc/compiler Import.java
Include.java StepPattern.java
java/src/org/apache/xalan/xsltc/compiler/util
ErrorMessages_no.java
java/src/org/apache/xalan/xsltc/dom LoadDocument.java
java/src/org/apache/xalan/xsltc/runtime BasisLibrary.java
java/src/org/apache/xalan/xsltc/trax
TemplatesHandlerImpl.java
TransformerFactoryImpl.java
Removed: java/src/org/apache/xalan/xsltc/compiler/util
ErrorMessages_en.java
Log:
Localised the runtime/dom packages into Norwegian. This proves that the
internationalisation work is completed. I also fixed a regression that
was caused by the error handling being changed.
PR: n/a (i18n and l10n work)
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.13 +8 -2
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java
Index: Import.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Import.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Import.java 2001/10/30 08:42:55 1.12
+++ Import.java 2001/10/31 07:29:38 1.13
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Import.java,v 1.12 2001/10/30 08:42:55 morten Exp $
+ * @(#)$Id: Import.java,v 1.13 2001/10/31 07:29:38 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -138,8 +138,14 @@
while (elements.hasMoreElements()) {
final Object element = elements.nextElement();
if (element instanceof TopLevelElement) {
- topStylesheet.addElement((TopLevelElement)element);
+ if (element instanceof Variable)
+ topStylesheet.addVariable((Variable)element);
+ else if (element instanceof Param)
+ topStylesheet.addParam((Param)element);
+ else
+ topStylesheet.addElement((TopLevelElement)element);
}
+
}
}
catch (Exception e) {
1.12 +7 -2
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java
Index: Include.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Include.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Include.java 2001/10/30 08:42:55 1.11
+++ Include.java 2001/10/31 07:29:38 1.12
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Include.java,v 1.11 2001/10/30 08:42:55 morten Exp $
+ * @(#)$Id: Include.java,v 1.12 2001/10/31 07:29:38 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -136,7 +136,12 @@
while (elements.hasMoreElements()) {
final Object element = elements.nextElement();
if (element instanceof TopLevelElement) {
- topStylesheet.addElement((TopLevelElement)element);
+ if (element instanceof Variable)
+ topStylesheet.addVariable((Variable)element);
+ else if (element instanceof Param)
+ topStylesheet.addParam((Param)element);
+ else
+ topStylesheet.addElement((TopLevelElement)element);
}
}
}
1.9 +1 -3
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java
Index: StepPattern.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/StepPattern.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StepPattern.java 2001/10/29 11:47:25 1.8
+++ StepPattern.java 2001/10/31 07:29:38 1.9
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: StepPattern.java,v 1.8 2001/10/29 11:47:25 morten Exp $
+ * @(#)$Id: StepPattern.java,v 1.9 2001/10/31 07:29:38 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -254,9 +254,7 @@
final int n = _predicates.size();
for (int i = 0; i < n; i++) {
Predicate pred = (Predicate)_predicates.elementAt(i);
- System.err.println("pred: "+pred);
Expression exp = pred.getExpr();
- System.err.println("exp: "+exp);
exp.translateDesynthesized(classGen, methodGen);
_trueList.append(exp._trueList);
_falseList.append(exp._falseList);
1.3 +6 -19
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages_no.java
Index: ErrorMessages_no.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages_no.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ErrorMessages_no.java 2001/10/30 15:35:30 1.2
+++ ErrorMessages_no.java 2001/10/31 07:29:39 1.3
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: ErrorMessages_no.java,v 1.2 2001/10/30 15:35:30 morten Exp $
+ * @(#)$Id: ErrorMessages_no.java,v 1.3 2001/10/31 07:29:39 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -68,7 +68,8 @@
public final class ErrorMessages_no extends ErrorMessages {
- // These message should be read from a locale-specific resource bundle
+ // Disse feilmeldingene maa korrespondere med konstantene som er definert
+ // i kildekoden til ErrorMsg.
private static final String errorMessages[] = {
// MULTIPLE_STYLESHEET_ERR
"En fil kan bare innehold ett stilark.",
@@ -246,30 +247,16 @@
" -s blokkerer alle kall til System.exit()."
};
- private static Vector _keys;
-
- static {
- _keys = new Vector();
- _keys.addElement(ErrorMsg.ERROR_MESSAGES_KEY);
- _keys.addElement(ErrorMsg.COMPILER_ERROR_KEY);
- _keys.addElement(ErrorMsg.COMPILER_WARNING_KEY);
- _keys.addElement(ErrorMsg.RUNTIME_ERROR_KEY);
- }
-
- public Enumeration getKeys() {
- return _keys.elements();
- }
-
public Object handleGetObject(String key) {
if (key == null) return null;
if (key.equals(ErrorMsg.ERROR_MESSAGES_KEY))
return errorMessages;
else if (key.equals(ErrorMsg.COMPILER_ERROR_KEY))
- return "Compiler error(s): ";
+ return "Kompilator-feil: ";
else if (key.equals(ErrorMsg.COMPILER_WARNING_KEY))
- return "Compiler warning(s): ";
+ return "Advarsel : ";
else if (key.equals(ErrorMsg.RUNTIME_ERROR_KEY))
- return "Translet error(s): ";
+ return "Kj\u00f8refeil: ";
return(null);
}
1.11 +5 -1
xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java
Index: LoadDocument.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/LoadDocument.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- LoadDocument.java 2001/10/30 14:57:54 1.10
+++ LoadDocument.java 2001/10/31 07:29:39 1.11
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: LoadDocument.java,v 1.10 2001/10/30 14:57:54 morten Exp $
+ * @(#)$Id: LoadDocument.java,v 1.11 2001/10/31 07:29:39 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -212,6 +212,9 @@
catch (java.io.FileNotFoundException e) {
return document((String)arg, xslURI, translet, dom);
}
+ catch (org.xml.sax.SAXParseException e) {
+ return document((String)arg, xslURI, translet, dom);
+ }
}
// Otherwise we must create a union iterator, add the nodes from
// all the DOMs to this iterator, and return the union in the end.
@@ -245,6 +248,7 @@
}
}
catch (Exception e) {
+ e.printStackTrace();
throw new TransletException(e);
}
}
1.26 +5 -4
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java
Index: BasisLibrary.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/BasisLibrary.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- BasisLibrary.java 2001/10/30 16:19:45 1.25
+++ BasisLibrary.java 2001/10/31 07:29:39 1.26
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: BasisLibrary.java,v 1.25 2001/10/30 16:19:45 morten Exp $
+ * @(#)$Id: BasisLibrary.java,v 1.26 2001/10/31 07:29:39 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -943,7 +943,7 @@
runTimeError(RUN_TIME_COPY_ERR);
}
}
-
+
public static final int RUN_TIME_INTERNAL_ERR = 0;
public static final int RUN_TIME_COPY_ERR = 1;
public static final int DATA_CONVERSION_ERR = 2;
@@ -963,10 +963,11 @@
// This array and the following 4 strings are read from that bundle.
private static String[] _errorMessages;
- public final static String ERROR_MESSAGES_KEY = "error-messages";
+ public final static String ERROR_MESSAGES_KEY = "error-messages";
static {
- ResourceBundle bundle =
ResourceBundle.getBundle("org.apache.xalan.xsltc.runtime.ErrorMessages",
Locale.getDefault());
+ String resource = "org.apache.xalan.xsltc.runtime.ErrorMessages";
+ ResourceBundle bundle = ResourceBundle.getBundle(resource);
_errorMessages = bundle.getStringArray(ERROR_MESSAGES_KEY);
}
1.3 +2 -3
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TemplatesHandlerImpl.java 2001/08/21 09:04:28 1.2
+++ TemplatesHandlerImpl.java 2001/10/31 07:29:39 1.3
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: TemplatesHandlerImpl.java,v 1.2 2001/08/21 09:04:28 morten Exp $
+ * @(#)$Id: TemplatesHandlerImpl.java,v 1.3 2001/10/31 07:29:39 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -75,7 +75,6 @@
*/
public class TemplatesHandlerImpl extends Parser implements TemplatesHandler
{
- private String _defaultTransletName = "GregorSamsa";
private String _systemId;
/**
@@ -135,7 +134,7 @@
final XSLTC xsltc = getXSLTC();
// Set the translet class name if not already set
- String transletName = _defaultTransletName;
+ String transletName = TransformerFactoryImpl._defaultTransletName;
if (_systemId != null) transletName = Util.baseName(_systemId);
xsltc.setClassName(transletName);
1.28 +15 -4
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
Index: TransformerFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- TransformerFactoryImpl.java 2001/10/30 14:57:54 1.27
+++ TransformerFactoryImpl.java 2001/10/31 07:29:39 1.28
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: TransformerFactoryImpl.java,v 1.27 2001/10/30 14:57:54 morten
Exp $
+ * @(#)$Id: TransformerFactoryImpl.java,v 1.28 2001/10/31 07:29:39 morten
Exp $
*
* The Apache Software License, Version 1.1
*
@@ -61,7 +61,6 @@
*
*/
-
package org.apache.xalan.xsltc.trax;
import java.io.File;
@@ -107,12 +106,24 @@
// This URIResolver is passed to all created Templates and Transformers
private URIResolver _uriResolver = null;
+ // As Gregor Samsa awoke one morning from uneasy dreams he found himself
+ // transformed in his bed into a gigantic insect. He was lying on his
hard,
+ // as it were armour plated, back, and if he lifted his head a little he
+ // could see his big, brown belly divided into stiff, arched segments, on
+ // top of which the bed quilt could hardly keep in position and was about
+ // to slide off completely. His numerous legs, which were pitifully thin
+ // compared to the rest of his bulk, waved helplessly before his eyes.
+ // "What has happened to me?", he thought. It was no dream....
+ protected static String _defaultTransletName = "GregorSamsa";
+
// Cache for the newTransformer() method - see method for details
- private String _defaultTransletName = "GregorSamsa";
private Transformer _copyTransformer = null;
+ // XSL document for the default transformer
private static final String COPY_TRANSLET_CODE =
"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"+
- "<xsl:template match=\"/\"><xsl:copy-of select=\".\"/></xsl:template>"+
+ "<xsl:template match=\"/\">"+
+ " <xsl:copy-of select=\".\"/>"+
+ "</xsl:template>"+
"</xsl:stylesheet>";
// This Hashtable is used to store parameters for locating
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]