<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Deal_with_XML_files</id>
	<title>Deal with XML files - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://95.179.246.60/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Deal_with_XML_files"/>
	<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Deal_with_XML_files&amp;action=history"/>
	<updated>2026-05-08T12:47:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>http://95.179.246.60/mediawiki/index.php?title=Deal_with_XML_files&amp;diff=177&amp;oldid=prev</id>
		<title>Nmingott: importe material</title>
		<link rel="alternate" type="text/html" href="http://95.179.246.60/mediawiki/index.php?title=Deal_with_XML_files&amp;diff=177&amp;oldid=prev"/>
		<updated>2025-05-12T20:39:19Z</updated>

		<summary type="html">&lt;p&gt;importe material&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;TODO&amp;#039;&amp;#039;&amp;#039;. Complete the task and upload an example data file with (prices made up).&lt;br /&gt;
&lt;br /&gt;
Many files today are encoded as XML. Some of them have a quite complex data structure and are hard to read for human eyes. But good news! In &amp;#039;&amp;#039;Cuis&amp;#039;&amp;#039; we have a package to deal with XML and &amp;#039;&amp;#039;Smalltalk&amp;#039;&amp;#039; makes exploring XML a lot more enjoyable than in any other programming language.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Problem&amp;#039;&amp;#039;&amp;#039;. I have a company price list in several &amp;#039;&amp;#039;LibreOffice&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;.odt&amp;#039;&amp;#039;&amp;#039; files. I want to update all those prices adding 1.5%.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;. Say you have a file &amp;#039;&amp;#039;priceList1.odt&amp;#039;&amp;#039; then:&lt;br /&gt;
&lt;br /&gt;
* Make a directory &amp;#039;&amp;#039;printList1Dir&amp;#039;&amp;#039; and copy &amp;#039;&amp;#039;princeList1.odt&amp;#039;&amp;#039; in there.&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; mkdir princeList1Dir&lt;br /&gt;
 $&amp;gt; cp priceList1.odt  priceList1Dir&lt;br /&gt;
 $&amp;gt; cd priceListdir&lt;br /&gt;
&lt;br /&gt;
* Unzip the file (yes, .odt file as just zipped document, isn&amp;#039;t it great?)&lt;br /&gt;
* Remove the zipped file from the new directory (you will see why later on)&lt;br /&gt;
&lt;br /&gt;
 $&amp;gt; unzip princeList1.odt &lt;br /&gt;
 $&amp;gt; rm princeList1.odt&lt;br /&gt;
&lt;br /&gt;
* Observe there is a file called &amp;#039;&amp;#039;&amp;#039;content.xml&amp;#039;&amp;#039;&amp;#039;, tadaaaa, we are going to work on that !&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;TO FINISH&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* Just started to collect the necessary commands for reading&lt;br /&gt;
* I miss commands for writing&lt;br /&gt;
* I need to work with true files to make this of any use&lt;br /&gt;
&lt;br /&gt;
 Feature require: &amp;#039;YAXO&amp;#039;. &lt;br /&gt;
 &lt;br /&gt;
 f1 _ &amp;#039;/home/p/download/test1-odt/content.xml&amp;#039; asFileEntry readStream . &lt;br /&gt;
 xdoc _ XMLDOMParser parseDocumentFrom: f1. &lt;br /&gt;
 f1 close. &lt;br /&gt;
 xdoc class. &amp;quot; XMLDocument &amp;quot;&lt;br /&gt;
 xdoc elements.   &amp;quot; show all elements &amp;quot;&lt;br /&gt;
 xdoc explore. &lt;br /&gt;
 &lt;br /&gt;
 t1 _ xdoc firstTagNamed: #&amp;#039;table:table&amp;#039;. &lt;br /&gt;
 t1 class. &amp;quot; XMLElement &amp;quot;&lt;br /&gt;
 t1 elements . &lt;br /&gt;
 &lt;br /&gt;
 t1 firstTagNamed: #&amp;#039;text:p&amp;#039;. &lt;br /&gt;
 &amp;quot; &amp;lt;text:p text:style-name=&amp;quot;P2&amp;quot;&amp;gt;1A&amp;lt;/text:p&amp;gt; &amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 t1 tagsNamed: #&amp;#039;text:p&amp;#039; do: [ :el | &lt;br /&gt;
 	Transcript log: (&amp;#039;	{1}&amp;#039; format: {el. }).  &lt;br /&gt;
 	Transcript log: (&amp;#039;- contents 	{1}&amp;#039; format: {el contents. }).  &lt;br /&gt;
 	].&lt;/div&gt;</summary>
		<author><name>Nmingott</name></author>
	</entry>
</feed>