Eliot Miranda uploaded a new version of XML-Explorer to project The Trunk: http://source.squeak.org/trunk/XML-Explorer-eem.3.mcz
==================== Summary ====================
Name: XML-Explorer-eem.3 Author: eem Time: 1 June 2023, 10:51:10.968993 am UUID: 3f0dea52-960d-4518-a674-e3c6b7841fac Ancestors: XML-Explorer-ct.2
Use LimitedWriteStream to control how much data is printed for each node in the explorer label. Arbitrarily set at 1000. Gives a huge improvement in responsiveness for very large XML documents (tested on an 18Mb XML document).
=============== Diff against XML-Explorer-ct.2 ===============
Item was changed: ----- Method: XMLElement>>asExplorerString (in category '*XML-Explorer') ----- asExplorerString + | sizeLimit stream | + sizeLimit := 1000. + stream := LimitedWriteStream on: (String new: 100). + stream + setLimit: sizeLimit + limitBlock: [stream setLimit: stream position + 4 limitBlock: nil. + stream nextPutAll: ' ...'. + ^ stream contents]. + self elementsAndContentsDo: + [:node | + node isText + ifTrue: + [stream nextPutAll: node asExplorerString] + ifFalse: + [node printXMLOn: (XMLWriter on: stream)]]. + ^stream contents! - - ^ String streamContents: [:stream | - self elementsAndContentsDo: [:node | - node isText - ifTrue: - [stream nextPutAll: node asExplorerString] - ifFalse: - [ | writer | - writer := XMLWriter on: stream. - node printXMLOn: writer]]]!
Item was changed: ----- Method: XMLStringNode>>asExplorerString (in category '*XML-Explorer') ----- asExplorerString + ^ self string size > 1000 + ifTrue: [(string copyFrom: 1 to: 1000), ' ...'] + ifFalse: [self string]! - ^ self string!
packages@lists.squeakfoundation.org