Skip to content

Exploring_XML

hhzl edited this page May 16, 2025 · 34 revisions

Gathering of existing material ...

Writing a XML file

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

Reading a XML file

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

FAO country names example

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

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

The file fao_country_names.xml seems to be no longer available in XML, see https://data.apps.fao.org/catalog/dataset/country-names

Find another candidate.

Pharo

https://github.com/pharo-contributions/XML-XMLParser

|xmlString| xmlString := ' Afghanistan Albania Algeria '.

(XMLDOMParser parse: xmlString) document root nodes inspect

Does not work, needs to be adapted.

Clone this wiki locally