dbertoni    00/05/29 15:43:47

  Modified:    c/src/XSLT XSLTProcessorEnvSupportDefault.cpp
  Log:
  Fixed bug where source document would be parsed multiple times.
  
  Revision  Changes    Path
  1.13      +18 -7     xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp
  
  Index: XSLTProcessorEnvSupportDefault.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/XSLTProcessorEnvSupportDefault.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XSLTProcessorEnvSupportDefault.cpp        2000/05/24 19:38:50     1.12
  +++ XSLTProcessorEnvSupportDefault.cpp        2000/05/29 22:43:47     1.13
  @@ -157,6 +157,8 @@
        using std::for_each;
   #endif
   
  +     m_defaultSupport.reset();
  +
        // Clean up the key table vector
        for_each(m_keyTables.begin(),
                         m_keyTables.end(),
  @@ -278,9 +280,6 @@
        }
        else
        {
  -             XMLParserLiaison&       parserLiaison =
  -                     m_processor->getXMLParserLiaison();
  -
                typedef URISupport::URLAutoPtrType      URLAutoPtrType;
   
                // $$$ ToDo: we should re-work this code to only use
  @@ -289,13 +288,25 @@
                        URISupport::getURLFromString(urlString, base);
   
                const XMLCh* const      urlText = xslURL->getURLText();
  +
  +             // First see if it's already been parsed...
  +             XalanDocument*          theDocument =
  +                     getSourceDocument(urlText);
   
  -             XSLTInputSource         inputSource(urlText);
  +             if (theDocument == 0)
  +             {
  +                     XMLParserLiaison&       parserLiaison =
  +                             m_processor->getXMLParserLiaison();
  +
  +                     XSLTInputSource         inputSource(urlText);
   
  -             XalanDocument*          theDocument = 
  -                     parserLiaison.parseXMLStream(inputSource);
  +                     theDocument = parserLiaison.parseXMLStream(inputSource);
   
  -             setSourceDocument(urlText, theDocument);
  +                     if (theDocument != 0)
  +                     {
  +                             setSourceDocument(urlText, theDocument);
  +                     }
  +             }
   
                return theDocument;
        }
  
  
  

Reply via email to