zongaro     2003/11/24 14:18:57

  Modified:    java/src/org/apache/xalan/xsltc/runtime ErrorMessages.java
               java/src/org/apache/xalan/xsltc/trax TemplatesImpl.java
               java/src/org/apache/xalan/xsltc/cmdline Transform.java
  Log:
  Patch from myself, reviewed by Morris Kwan ([EMAIL PROTECTED]):
  
  Introduced a versioning mechanism in AbstractTranslet.  After constructing an
  object of a class that extends AbstractTranslet, the postInitialization method
  must be called.  That method will detect any versioning differences that can
  be resolved automatically, if a translet was compiled with an older version of
  the XSLTC than is being used at run-time.  The version number is stored in the
  translet's transletVersion field.
  
  In many cases, incompabilities run up against Java's binary compatibility
  rules, and fail catastrophically.  This versioning mechanism is designed to
  detect those cases that can't be detected by the JVM.  The first use of this
  mechanism is to translate from the old form of the namesArray used by old
  translets, to the new form expected by the modified version of the XSLTC
  run-time, as described above.
  
  In addition, if the translet version detected by the XSLTC run-time is more
  recent than any supported by the XSLTC run-time, an error will be reported.
  
  Revision  Changes    Path
  1.8       +17 -6     
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages.java
  
  Index: ErrorMessages.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/ErrorMessages.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ErrorMessages.java        22 Oct 2003 20:23:48 -0000      1.7
  +++ ErrorMessages.java        24 Nov 2003 22:18:57 -0000      1.8
  @@ -112,6 +112,8 @@
    *      grammar for an XML file, the names and types of elements, attributes,
    *      etc.
    *
  + *   9) Translet is an invented term that refers to the class file that 
contains
  + *      the compiled form of a stylesheet.
    */
   
       // These message should be read from a locale-specific resource bundle
  @@ -257,7 +259,7 @@
            */
           {BasisLibrary.CANT_RESOLVE_RELATIVE_URI_ERR,
           "Could not resolve the URI reference ''{0}''."},
  - 
  +
            /*
            * Note to translators:  The stylesheet contained an element that was
            * not recognized as part of the XSL syntax.  The substitution text
  @@ -268,13 +270,22 @@
   
           /*
            * Note to translators:  The stylesheet referred to an extension to 
the
  -         * XSL syntax and indicated that it was defined by XSLTC, but XSTLC 
does
  -         * not recognized the particular extension named.  The substitution 
text
  +         * XSL syntax and indicated that it was defined by XSLTC, but XSLTC 
does
  +         * not recognize the particular extension named.  The substitution 
text
            * gives the extension name.
            */
           {BasisLibrary.UNSUPPORTED_EXT_ERR,
  -        "Unrecognised XSLTC extension ''{0}''"}
  -       
  +        "Unrecognized XSLTC extension ''{0}''"},
  +
  +
  +        //
  +        // Note to translators:  This error message is produced if the 
translet
  +        // class was compiled using a newer version of XSLTC and deployed for
  +        // execution with an older version of XSLTC.  The substitution text 
is
  +        // the name of the translet class.
  +        //
  +        {BasisLibrary.UNKNOWN_TRANSLET_VERSION_ERR,
  +        "The specified translet, ''{0}'', was created using a version of 
XSLTC more recent than the version of the XSLTC run-time that is in use.  You 
must recompile the stylesheet or use a more recent version of XSLTC to run this 
translet."}
       };
   
       public Object[][] getContents() {
  
  
  
  1.31      +2 -1      
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java
  
  Index: TemplatesImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TemplatesImpl.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- TemplatesImpl.java        22 Oct 2003 23:25:07 -0000      1.30
  +++ TemplatesImpl.java        24 Nov 2003 22:18:57 -0000      1.31
  @@ -370,6 +370,7 @@
            // The translet needs to keep a reference to all its auxiliary 
            // class to prevent the GC from collecting them
            AbstractTranslet translet = (AbstractTranslet) 
_class[_transletIndex].newInstance();
  +            translet.postInitialization();
            translet.setTemplates(this);
            if (_auxClasses != null) {
                translet.setAuxiliaryClasses(_auxClasses);
  
  
  
  1.29      +2 -1      
xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java
  
  Index: Transform.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/cmdline/Transform.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Transform.java    31 Oct 2003 14:14:32 -0000      1.28
  +++ Transform.java    24 Nov 2003 22:18:57 -0000      1.29
  @@ -139,6 +139,7 @@
               final Class clazz = ObjectFactory.findProviderClass(
                   _className, ObjectFactory.findClassLoader(), true);
            final AbstractTranslet translet = 
(AbstractTranslet)clazz.newInstance();
  +            translet.postInitialization();
   
            // Create a SAX parser and get the XMLReader object it uses
            final SAXParserFactory factory = SAXParserFactory.newInstance();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to