The Trunk: XML-Explorer-topa.1.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: XML-Explorer-topa.1.mcz

commits-2
Tobias Pape uploaded a new version of XML-Explorer to project The Trunk:
http://source.squeak.org/trunk/XML-Explorer-topa.1.mcz

==================== Summary ====================

Name: XML-Explorer-topa.1
Author: topa
Time: 9 June 2016, 4:23:14.612174 pm
UUID: 163e18e6-abb1-4fbc-8648-3c76cedd6809
Ancestors:

Improve experience of exploring XML documents

==================== Snapshot ====================

----- Method: XMLElement>>asExplorerString (in category '*XML-Explorer') -----
asExplorerString

        ^ String streamContents: [:stream |
                self elementsAndContentsDo: [:node |
                        node isText
                                ifTrue:
                                        [stream nextPutAll: node asExplorerString]
                                ifFalse:
                                        [ | writer |
                                        writer := XMLWriter on: stream.
                                        node printXMLOn: writer]]]!

----- Method: XMLElement>>explorerContents (in category '*XML-Explorer') -----
explorerContents

        ^ super explorerContents, (self attributes keysSortedSafely collect: [ :key |
                ObjectExplorerWrapper
                        with: (self attributes at: key)
                        name: (key asString contractTo: 32)
                        model: self attributes ])
!

----- Method: XMLNodeWithElements>>explorerContents (in category '*XML-Explorer') -----
explorerContents

        ^ self elementsAndContents collect: [:element |
                | name |
                name := element isTag
                        ifTrue: ['<{1}>' format: {element name}]
                        ifFalse: [element isText
                                ifTrue: ['[character data]']
                                ifFalse: [element]].
                ObjectExplorerWrapper
                        with: element
                        name: (name asString contractTo: 32)
                        model: self ]
!

----- Method: XMLDocument>>asExplorerString (in category '*XML-Explorer') -----
asExplorerString

        ^ String streamContents: [:stream |
                stream
                        nextPutAll: self topElement localName;
                        nextPutAll: ' (XML'.
                version ifNotNil: [:v | stream space; nextPutAll: v].
                encoding ifNotNil: [:e | stream space; nextPutAll: e].
                stream nextPut: $)].!

----- Method: XMLStringNode>>asExplorerString (in category '*XML-Explorer') -----
asExplorerString
        ^ self string!

----- Method: XMLStringNode>>hasContentsInExplorer (in category '*XML-Explorer') -----
hasContentsInExplorer
        ^false!