<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 6, 2011, at 10:06 PM, Bruce Leban wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">. Personally, the xml writer seems like a reasonable use to me.</div></blockquote><br></div><div>I'm surprised that you like the XML writer.  To me it seems much more awkward to type the python code than the XML it generates:</div><div><br></div><div><meta charset="utf-8"><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; ">  w = XmlWriter.Create(System.Console.Out,XmlWriterSettings(Indent=True))<br>  x = XWriter(w)<br><br><span class="srckeyw" style="color: rgb(0, 0, 255); ">  with</span> x.element(<span class="srctext" style="color: rgb(0, 128, 0); ">'tableofcontents'</span>):<br>    <span class="srckeyw" style="color: rgb(0, 0, 255); ">with</span> x.element(<span class="srctext" style="color: rgb(0, 128, 0); ">'section'</span>,{<span class="srctext" style="color: rgb(0, 128, 0); ">'page'</span> : <span class="srctext" style="color: rgb(0, 128, 0); ">'10'</span>}):<br>       x.text(<span class="srctext" style="color: rgb(0, 128, 0); ">'Introduction'</span>)<br>    <span class="srckeyw" style="color: rgb(0, 0, 255); ">with</span> x.element(<span class="srctext" style="color: rgb(0, 128, 0); ">'section'</span>,{<span class="srctext" style="color: rgb(0, 128, 0); ">'page'</span> : <span class="srctext" style="color: rgb(0, 128, 0); ">'12'</span>}):<br>       x.text(<span class="srctext" style="color: rgb(0, 128, 0); ">'Main topic'</span>)<br>    <span class="srckeyw" style="color: rgb(0, 0, 255); ">with</span> x.element(<span class="srctext" style="color: rgb(0, 128, 0); ">'section'</span>,{<span class="srctext" style="color: rgb(0, 128, 0); ">'page'</span> : <span class="srctext" style="color: rgb(0, 128, 0); ">'14'</span>}):<br>       x.text(<span class="srctext" style="color: rgb(0, 128, 0); ">'Extra topic'</span>)<br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; ">Generates:</span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; "><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; "><meta charset="utf-8">  <tableofcontents><br>    <section page="10">Introduction</section><br>    <section page="12">Main topic</section><br>    <section page="14">Extra topic</section><br>  </tableofcontents><br></span></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; "><br></span></div><div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: pre;">At least in this example, it seems to me that the XML writer created more work and more complexity than it saved.</span></font></div><div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: pre;"><br></span></font></div><div><font class="Apple-style-span" face="monospace" size="3"><span class="Apple-style-span" style="font-size: 11px; white-space: pre;">Raymond</span></font></div><div><span class="Apple-style-span" style="font-family: monospace; font-size: 11px; white-space: pre; "><br></span></div></body></html>