tmiller     01/06/27 11:47:05

  Modified:    java/src/org/apache/xalan/xsltc/trax TransletTemplates.java
  Log:
  added a new sys property called 'transletPool'
  to allow user to set the destination directory for generated translets
  
  Revision  Changes    Path
  1.2       +20 -1     
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransletTemplates.java
  
  Index: TransletTemplates.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransletTemplates.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TransletTemplates.java    2001/06/26 17:19:59     1.1
  +++ TransletTemplates.java    2001/06/27 18:47:04     1.2
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: TransletTemplates.java,v 1.1 2001/06/26 17:19:59 tmiller Exp $
  + * @(#)$Id: TransletTemplates.java,v 1.2 2001/06/27 18:47:04 tmiller Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -70,6 +70,8 @@
   
   import org.apache.xalan.xsltc.runtime.AbstractTranslet;
   import org.apache.xalan.xsltc.compiler.XSLTC;
  +import org.apache.xalan.xsltc.compiler.CompilerException;
  +import org.apache.xalan.xsltc.compiler.util.Util;
   import org.apache.xalan.xsltc.Translet;
   import java.util.Properties;
   
  @@ -94,6 +96,19 @@
           XSLTC xsltc = new XSLTC();
           xsltc.init();
   
  +        // check if destination has been set with system property
  +        String transletDestDir = System.getProperty("transletPool");
  +        if (transletDestDir != null) {
  +            try {
  +                xsltc.setDestDirectory(transletDestDir);
  +            } catch(CompilerException e)  {
  +                throw new TransformerConfigurationException(
  +                    "System property 'transletPool' was set to  " +
  +                    transletDestDir + ", " + e );
  +            }
  +        }
  +
  +
        // compile stylesheet
        boolean isSuccessful = true;
        StreamSource strmsrc = (StreamSource)_stylesheet;
  @@ -103,6 +118,7 @@
        if (inputStream != null) {
            isSuccessful = xsltc.compile(inputStream, transletName);
        } else if (stylesheetName != null ){
  +/******************
            int index = stylesheetName.indexOf('.');
            if (index > 0) { 
                   transletName = stylesheetName.substring(0,index);
  @@ -111,6 +127,9 @@
                   // indexOf returns -1 if '.' is not present
                   transletName = stylesheetName;
               }   
  +********************/
  +         transletName = Util.toJavaName(Util.noExtName(
  +                Util.baseName(stylesheetName)));
               try {
                   if (stylesheetName.startsWith("file:/")) {
                       isSuccessful = xsltc.compile(new URL(stylesheetName));
  
  
  

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

Reply via email to