Writing to file vs. storing in a variable
I have been an XSL file that compares two files. There are three main steps: 1. Compare the two files and store the results in a variable 2. Use the variable to create a header in output File A 3. Write the contents of the variable to output File A I have been using large XML files for the comparison, and the memory consumption is pretty large. It is manageable, but if a couple are running at the same time, running out of memory is definitely a possibility. It finally dawned upon me(I am a little slow) that I could break the XSL file up into three parts: 1. Compare the two files, writing the results immediately to File A 2. Read up File A(much smaller than the originals), writing the header to File B 3. Copy the contents of File A to File B This approach cut down on memory consumption quite a bit. The problem is that the first part of the second approach takes about 50% LONGER than all of the steps in the first approach. I have tried using Saxon and Xalan, and they are pretty equivalent(other than Xalan being a big memory hog). Can anybody explain to me why this would be the case? Thank you, Matt Youngblut XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format