xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zong...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/client XSLTProcessorApplet.java
Date Mon, 20 Oct 2003 19:10:35 GMT
zongaro     2003/10/20 12:10:35

  Modified:    java/src/org/apache/xalan/client Tag: xslt20-compiled
                        XSLTProcessorApplet.java
  Log:
  Patch from Christine Li (jycli@ca.ibm.com) for Bugzilla bug report 19823.
  
  Added code to use a Hashtable to keep track of parameters set for an applet.
  The old implementation allowed just one parameter to be specified for the
  transformation.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.18.6.2  +17 -10    xml-xalan/java/src/org/apache/xalan/client/XSLTProcessorApplet.java
  
  Index: XSLTProcessorApplet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/client/XSLTProcessorApplet.java,v
  retrieving revision 1.18.6.1
  retrieving revision 1.18.6.2
  diff -u -r1.18.6.1 -r1.18.6.2
  --- XSLTProcessorApplet.java	17 Oct 2003 21:20:26 -0000	1.18.6.1
  +++ XSLTProcessorApplet.java	20 Oct 2003 19:10:35 -0000	1.18.6.2
  @@ -64,6 +64,8 @@
   import java.io.StringWriter;
   import java.net.MalformedURLException;
   import java.net.URL;
  +import java.util.Hashtable;
  +import java.util.Enumeration;
   
   import javax.xml.transform.Templates;
   import javax.xml.transform.Transformer;
  @@ -239,6 +241,9 @@
       // styleURL: Parameter description
       //----------------------------------------------------------------------
       param = getParameter(PARAM_styleURL);
  +    
  +    // stylesheet parameters
  +    m_parameters = new Hashtable();
   
       if (param != null)
         setStyleURL(param);
  @@ -392,14 +397,14 @@
     }
   
     /** 
  -   * Stylesheet parameter key
  +   * Stylesheet parameter keys
      */
  -  transient String m_key;
  +  private Enumeration m_keys;
   
     /** 
  -   * Stylesheet parameter value
  +   * Stylesheet parameter key/value pair stored in a hashtable
      */
  -  transient String m_expression;
  +  transient Hashtable m_parameters;  
   
     /**
      * Submit a stylesheet parameter.
  @@ -410,8 +415,7 @@
      */
     public void setStylesheetParam(String key, String expr)
     {
  -    m_key = key;
  -    m_expression = expr;
  +    m_parameters.put(key, expr);
     }
   
     /**
  @@ -692,10 +696,13 @@
   
           Transformer transformer = m_tfactory.newTransformer(xslSource);
   
  -        if (null != m_key)
  -          transformer.setParameter(m_key, m_expression);
  -      
  -         transformer.transform(xmlSource, result);
  +        m_keys = m_parameters.keys();
  +        while (m_keys.hasMoreElements()){
  +          Object key = m_keys.nextElement();
  +          Object expression = m_parameters.get(key);
  +          transformer.setParameter((String) key, expression);
  +        }
  +        transformer.transform(xmlSource, result);
         }
         catch (TransformerConfigurationException tfe)
         {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message