<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
<title>Stupid conversion tricks</title><biblioid class="uri">http://norman.walsh.name/2007/03/03/conversion</biblioid>
<volumenum>10</volumenum>
<issuenum>18</issuenum>
<pubdate>2007-03-03T17:16:55-05:00</pubdate>
<date>$Date: 2007-03-03 17:53:20 -0500 (Sat, 03 Mar 2007) $</date>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2007</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>It doesn't matter how many steps it takes as long as it's fun, right?</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XML"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#XSLT2"/>
</info>

<para xml:id="p1">Start with a
<wikipedia page="Microsoft_Word">Word</wikipedia> document
containing names and addresses in a three-up, label-ready format.</para>

<para xml:id="p2">Open that document with <wikipedia page="OpenOffice.org">OpenOffice</wikipedia>
and save it as a OpenOffice Text document. Unzip that. Now you have XML.</para>

<para xml:id="p3">Pretty-print <filename>content.xml</filename>. Peek at it. Fairly
reasonable XML, in fact.</para>

<para xml:id="p4">Craft a 25 line <wikipedia page="XSL_Transformations">XSLT</wikipedia>
stylesheet to extract the names and addresses and store them
in <wikipedia page="Comma-separated_values">CSV</wikipedia> format.
Cheer for <wikipedia page="Regular_expression">RegEx</wikipedia> support in
XSLT 2.0.
</para>

<para xml:id="p5">Fix a few irregularities in the XML with <wikipedia>Emacs</wikipedia>.
Iterate until done.</para>

<para xml:id="p6">Open the CSV file with the OpenOffice and save it as an
<wikipedia page="Microsoft_Excel">Excel</wikipedia> spreadsheet.</para>

<para xml:id="p7">Now you have a “database” of names and addresses. I'm not quite
sure why that was the desired format, but it only took about ten
minutes and didn't require rekeying any data.</para>

<para xml:id="p8">I call that a win.</para>

</essay>

