[...] stream := WriteStream on: (String new: 4000). DrGeoXml new app: self app; saveOn: stream. [...]
DrGeoXml>>saveOn: stream | doc writer root | doc := XMLDocument new version: '1.0'. writer := XMLWriter on: stream. root := XMLElement named: #drgenius. self writeFigureAsXmlTo: root. doc addElement: root. doc printXMLOn: writer. The stream is passed to the XMLWriter, then it goes down to each items of the sketch to write its own XML node. For example, to write its basic information as its name, where I have issue: writeAsXmlTo: aNode "return the newly created element" | node | self rehash. node := XMLElement named: self basicType attributes: Dictionary new. node attributeAt: #type put: self nodeType; attributeAt: #name put: (name ifNil: ['']); attributeAt: #id put: self hash asString. self writeParentsAsXmlTo: node. aNode addElement: node. ^node This code is as is since about 2005-2007 I will dig in it but it is strange. Le 24/07/2019 à 18:45, Sven Van Caekenberghe a écrit : > But how do you write it to a file then ? > > FileLocator desktop / 'hilaire.xml' writeStreamDo: [ :out | out << 'Les > élèves Françaises ont 10 €' ]. > > (FileLocator desktop / 'hilaire.xml') contents. > > ">> 'Les élèves Françaises ont 10 €'" -- Dr. Geo http://drgeo.eu