Skip to content

Working with XML files tutorial

hhzl edited this page May 13, 2025 · 13 revisions

It seems that working with XML files is the same in Cuis, Squeak and Pharo.

https://wiki.squeak.org/squeak/505

XMLDOMParser https://wiki.squeak.org/squeak/6342

Hernan Morales Durand: blog https://80738163270632.blogspot.com/2015/02/pharo-smalltalk-scripts-part-1.html

(XMLDOMParser parseFileNamed: 'fao_country_names.xml') 
  firstNode 
  allElementsSelect: [ : each | 
    each localName = 'geographical_region' ].

Pharo https://github.com/SquareBracketAssociates/Booklet-XML

Reading an XML file

https://wiki.squeak.org/squeak/6433

from the Squeak help XML tutorial

| doc |
	doc := HTTPClient httpGetDocument: 'http://source.squeak.org/trunk/feed.rss'.
	XMLDOMParser parseDocumentFrom: (ReadStream on: (doc content)).

Writing an XML file

https://wiki.squeak.org/squeak/6338

SVG construction example 2 - rect (rectangle) and text (XMLElement) https://wiki.squeak.org/squeak/6438

Clone this wiki locally