xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mk...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/lib ExsltDynamic.java
Date Tue, 05 Nov 2002 18:18:51 GMT
mkwan       2002/11/05 10:18:51

  Modified:    java/src/org/apache/xalan/lib ExsltDynamic.java
  Log:
  Fix a problem in the max() function. Reuse the Document object to reduce
  memory usage.
  
  Revision  Changes    Path
  1.7       +10 -7     xml-xalan/java/src/org/apache/xalan/lib/ExsltDynamic.java
  
  Index: ExsltDynamic.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/ExsltDynamic.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ExsltDynamic.java	4 Nov 2002 15:18:20 -0000	1.6
  +++ ExsltDynamic.java	5 Nov 2002 18:18:51 -0000	1.7
  @@ -145,7 +145,7 @@
       NodeSetDTM contextNodes = new NodeSetDTM(nl, xctxt);
       xctxt.pushContextNodeList(contextNodes);
       
  -    double maxValue = Double.MIN_VALUE;
  +    double maxValue = - Double.MAX_VALUE;
       for (int i = 0; i < contextNodes.getLength(); i++)
       {
         int contextNode = contextNodes.item(i);
  @@ -397,6 +397,8 @@
       throws SAXNotSupportedException
     {
       XPathContext xctxt = null;
  +    Document lDoc = null;
  +    
       if (myContext instanceof XPathContext.XPathExpressionContext)
         xctxt = ((XPathContext.XPathExpressionContext) myContext).getXPathContext();
       else
  @@ -438,12 +440,13 @@
           }
           else
           {
  -          Document lDoc = null;
  -
  -          DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  -          dbf.setNamespaceAware(true);
  -          DocumentBuilder db = dbf.newDocumentBuilder();
  -          lDoc = db.newDocument();
  +	  if (lDoc == null)
  +	  {
  +            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  +            dbf.setNamespaceAware(true);
  +            DocumentBuilder db = dbf.newDocumentBuilder();
  +            lDoc = db.newDocument();
  +          }
           
             Element element = null;
             if (object instanceof XNumber)
  
  
  

---------------------------------------------------------------------
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