<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Keith's Blog &#187; XML</title>
	<atom:link href="http://kfahlgren.com/blog/category/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://kfahlgren.com/blog</link>
	<description>Keith on XML, Publishing, Ruby, Birds, &#038; San Francisco</description>
	<lastBuildDate>Fri, 09 Apr 2010 15:59:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>O&#8217;Reilly Release ePubs</title>
		<link>http://kfahlgren.com/blog/2008/07/15/oreilly-release-epubs/</link>
		<comments>http://kfahlgren.com/blog/2008/07/15/oreilly-release-epubs/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 19:01:46 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DocBook]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>
		<category><![CDATA[ePub]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/?p=68</guid>
		<description><![CDATA[As of today, 30 O&#8217;Reilly titles are available as Ebook bundles and many will be in the Kindle Store later today:
As promised last month, O&#8217;Reilly has released 30 titles as DRM-free downloadable ebook bundles. The bundles include three ebook formats (EPUB, PDF, and Kindle-compatible Mobipocket) for a single price &#8212; at or below the book&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>As of today, <a href="http://toc.oreilly.com/2008/07/30-oreilly-titles-now-available-as-ebook-bundles.html">30 O&#8217;Reilly titles are available as Ebook bundles and many will be in the Kindle Store later today</a>:</p>
<blockquote><p>As <a href="http://toc.oreilly.com/2008/06/select-oreilly-books-soon-on-kindle-and-as-drm-free-digital-bundle.html">promised last month</a>, O&#8217;Reilly has released 30 titles as DRM-free downloadable ebook bundles. The bundles include three ebook formats (EPUB, PDF, and Kindle-compatible Mobipocket) for a single price &#8212; at or below the book&#8217;s cover price.</p></blockquote>
<p>I&#8217;ve spent a reasonable chunk of my year helping make this happen, both on the O&#8217;Reilly side and by adding <a href="http://openebooks.org">.epub</a> support to the <a href="http://sourceforge.net/forum/forum.php?forum_id=831189">DocBook-XSL stylesheets</a> with <a href="http://blogs.adobe.com/digitaleditions/2008/06/docbook_xsl_epub_target_is_rea.html">Paul Norton</a> of Adobe. Hopefully, our customers will be happy with the new formats.</p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2008/07/15/oreilly-release-epubs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML for Publishers at TOC</title>
		<link>http://kfahlgren.com/blog/2008/02/14/xml-for-publishers-at-toc/</link>
		<comments>http://kfahlgren.com/blog/2008/02/14/xml-for-publishers-at-toc/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 17:41:50 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[DocBook]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[toccon08]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2008/02/14/xml-for-publishers-at-toc/</guid>
		<description><![CDATA[
 
 
 
  Keith Fahlgren at his TOC Tutorial, XML for Publishers
  
  Originally uploaded by duncandavidson
 

I just got back from New York and the second annual O&#8217;Reilly Tools of Change for Publishing (TOC) Conference. It&#8217;s become a very impressive conference in just two years and had impressive attendance and [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;">
 <a href="http://www.flickr.com/photos/x180/2263580148/" title="photo sharing"><img src="http://farm3.static.flickr.com/2037/2263580148_faac80d0b3_m.jpg" alt="" style="border: solid 2px #000000;" /></a><br />
 <br />
 <span style="font-size: 0.9em; margin-top: 0px;"><br />
  <a href="http://www.flickr.com/photos/x180/2263580148/">Keith Fahlgren at his TOC Tutorial, XML for Publishers</a><br />
  <br />
  Originally uploaded by <a href="http://www.flickr.com/people/x180/">duncandavidson</a><br />
 </span>
</div>
<p>I just got back from New York and the second annual <a href="http://toccon.com">O&#8217;Reilly Tools of Change for Publishing (TOC) Conference</a>. It&#8217;s become a very impressive conference in just two years and had impressive attendance and speakers this year. There&#8217;s good blog coverage from <a href="http://www.georgewalkley.com/2008/02/13/tools-of-change-closing-observations/">George Walkley</a> and pointers to more from the <a href="http://toc.oreilly.com/">new TOC blog</a>. </p>
<p>I had the honor of doing <a href="http://en.oreilly.com/toc2008/public/schedule/detail/553">a tutorial</a> on the last day and had a great time talking with and teaching an energized, question-happy audience about XML in the publishing industry. If you weren&#8217;t able to make it to TOC this year, you can pre-order the DVDs of four of the eight tutorials, including mine, and get 30% off with discount code TOCD3. Here&#8217;s the link: <a href="http://www.oreilly.com/catalog/9780596519858/">XML for Publishers</a>.<br />
<br clear="all" /></p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2008/02/14/xml-for-publishers-at-toc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DocBook-XSL Sytlesheets have &gt;600 Parameters</title>
		<link>http://kfahlgren.com/blog/2007/06/13/docbook-xsl-sytlesheets-have-600-parameters/</link>
		<comments>http://kfahlgren.com/blog/2007/06/13/docbook-xsl-sytlesheets-have-600-parameters/#comments</comments>
		<pubDate>Wed, 13 Jun 2007 22:33:55 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[DocBook]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/06/13/docbook-xsl-sytlesheets-have-600-parameters/</guid>
		<description><![CDATA[Norm Walsh writes:
Stylesheets can have literally hundreds of parameters. The DocBook XSL Stylesheets have more than six hundred.
All I can say at this point is: wow. Grepping the core of our own customization shows 121 &#60;xsl:param&#62;s (about 20 of which we introduced) and 52 &#60;xsl:attribute-set&#62;s (20, again). Thinking about it now (as I haven&#8217;t before), [...]]]></description>
			<content:encoded><![CDATA[<p>Norm Walsh <a href="http://norman.walsh.name/2007/06/13/xprocParameters">writes</a>:</p>
<blockquote><p>Stylesheets can have literally hundreds of parameters. The <a href="http://wiki.docbook.org/topic/DocBookXslStylesheets">DocBook XSL Stylesheets</a> have more than six hundred.</p></blockquote>
<p>All I can say at this point is: wow. Grepping the core of our own customization shows 121 <tt>&lt;xsl:param&gt;</tt>s (about 20 of which we introduced) and 52 <tt>&lt;xsl:attribute-set&gt;</tt>s (20, again). Thinking about it now (as I haven&#8217;t before), we&#8217;ve probably minimized that number by completely overriding 13 of the &#8220;regular&#8221; <tt>fo/</tt> stylesheets directly (rather than using params or smaller, single-template overrides). The DocBook-XSL sytlesheets are a truly impressive, complex project. </p>
<p>Their complexity brings me to the other DocBook-related news item from today, in which Bob DuCharme <a href="http://www.snee.com/bobdc.blog/2007/06/developerworks_article_on_xhtm.html">argues</a> that XHTML 2: </p>
<blockquote><p>will hit a sweet spot between the richness of DocBook and the simplicity of XHTML 1</p></blockquote>
<p>I&#8217;m certainly hopeful that our work in the <a href="http://wiki.docbook.org/topic/Publishers">DocBook SubCommittee for Publishers</a> will move a subset of DocBook closer to that &#8220;sweet spot&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/06/13/docbook-xsl-sytlesheets-have-600-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partial Updates: A Simpler Strawman?</title>
		<link>http://kfahlgren.com/blog/2007/06/10/partial-updates-a-simpler-strawman/</link>
		<comments>http://kfahlgren.com/blog/2007/06/10/partial-updates-a-simpler-strawman/#comments</comments>
		<pubDate>Sun, 10 Jun 2007 19:51:45 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[AtomPub]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PATCH]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/06/10/partial-updates-a-simpler-strawman/</guid>
		<description><![CDATA[James Snell has been working some interesting things as the work on the Atom Publishing Protocol spec winds down. Most recently, he posted some thoughts on how to effectively communicate partial updates to APP servers using HTTP PATCH. 
[UPDATE: James points out the obvious drawback to this approach in his response.]
One of the things that [...]]]></description>
			<content:encoded><![CDATA[<p>James Snell has been working some interesting <a href="http://www.snellspace.com/wp/?p=682">things</a> as the work on the <a href="http://ietfreport.isoc.org/idref/draft-ietf-atompub-protocol/">Atom Publishing Protocol spec</a> winds down. Most recently, <a href="http://www.snellspace.com/wp/?p=683">he posted some thoughts</a> on how to effectively communicate partial updates to APP servers using HTTP PATCH. </p>
<p>[UPDATE: James points out the obvious drawback to this approach <a href="http://www.snellspace.com/wp/?p=684">in his response</a>.]</p>
<p>One of the things that surprised me when I met other APP implementors at the <a href="http://www.oreillynet.com/xml/blog/2007/04/atom_publishing_protocol_inter.html">interop</a> was the relative lack of concern they seemed to have about the actual content inside their <code>&lt;atom:entry&gt;</code>s. This may have simply been a simplification on their part for the sake of testing  (<a href="https://ape.dev.java.net/source/browse/ape/src/samples.rb?view=markup">&#8220;if it can accept a single line of XHTML div it can accept <em>anything</em>&#8220;</a>, essentially) rather than their real views, but to someone very concerned about perfect content fidelity, it sorta scared me. These tiny <code>&lt;atom:entry&gt;</code>s might hide the some of the problems that APP will face in the wild, particularly for document repositories.</p>
<p>Long before the interop, we&#8217;d decided internally at O&#8217;Reilly to use the Media Resources rather than the <code>&lt;atom:entry&gt;</code> container (in large part because of the size of our DocBook documents, often over 2MB) for our document repository implementation. Because of the larger size of our content blocks, the sort of partial updates that James is thinking about might be quite cool. </p>
<p>The core of James&#8217; strawman is an XML delta syntax (with credit due to <a href="http://andyroberts007.blogspot.com/2006/04/delta-web_03.html">Andy Roberts</a>&#8216; work on the same) for HTTP PATCH with 8  operations: insert-before, insert-after, insert-child, replace, remove, remove-all, set-attribute and remove-attribute. Coming at this problem with my experience in document transformation and XSLT, I saw 7 of those operations (everything but &#8216;replace&#8217;) as unnecessary. The basic inspiration is thinking about each operation as an XSLT template. Mentally translate the <code>d:replace/@path</code> into <code>xsl:template/@match</code> and swap the bodies and you&#8217;ll be with me (with luck!).</p>
<p>Here&#8217;s the specific rundown of the 7 operations other than &#8216;replace&#8217; working with James&#8217; simple example <code>&lt;atom:entry&gt;</code>:</p>
<pre>
<font color="#ffff00"><b> 1 </b></font><font color="#00ffff"><b>&lt;?</b></font><font color="#00ff00"><b>xml</b></font><font color="#00ff00"><b> </b></font><font color="#00ff00"><b>version</b></font>=<font color="#ff40ff"><b>&quot;1.0&quot;</b></font><font color="#00ffff"><b>?&gt;</b></font>
<font color="#ffff00"><b> 2 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>entry</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b> 3 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>id</b></font><font color="#00ffff"><b>&gt;</b></font><a href="http://example.org/foo/boo">http://example.org/foo/boo</a><font color="#00ffff"><b>&lt;/id&gt;</b></font>
<font color="#ffff00"><b> 4 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>title</b></font><font color="#00ffff"><b>&gt;</b></font>Test<font color="#00ffff"><b>&lt;/title&gt;</b></font>
<font color="#ffff00"><b> 5 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>updated</b></font><font color="#00ffff"><b>&gt;</b></font>2007-12-12T12:12:12Z<font color="#00ffff"><b>&lt;/updated&gt;</b></font>
<font color="#ffff00"><b> 6 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>summary</b></font><font color="#00ffff"><b>&gt;</b></font>Test summary<font color="#00ffff"><b>&lt;/summary&gt;</b></font>
<font color="#ffff00"><b> 7 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>author</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b> 8 </b></font>    <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>name</b></font><font color="#00ffff"><b>&gt;</b></font>James<font color="#00ffff"><b>&lt;/name&gt;</b></font>
<font color="#ffff00"><b> 9 </b></font>  <font color="#00ffff"><b>&lt;/author&gt;</b></font>
<font color="#ffff00"><b>10 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#00ffff"><b>link</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>href</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org">http://example.org</a>&quot;</b></font><font color="#00ffff"><b>/&gt;</b></font>
<font color="#ffff00"><b>11 </b></font><font color="#00ffff"><b>&lt;/entry&gt;</b></font>
</pre>
<p>Note: You&#8217;ll have to imagine these working on a much larger XML document than my examples to understand the importance.</p>
<h3>insert-before</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for insert-before</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:author/atom:name</b></font>
<font color="#ffff00"><b>14 </b></font><font color="#00ffff"><b>       an atom:email --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:author&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>    <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>17 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>email</b></font><font color="#00ffff"><b>&gt;</b></font>james@example.org<font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>email&gt;</b></font>
<font color="#ffff00"><b>18 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name</b></font><font color="#00ffff"><b>&gt;</b></font>James<font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name&gt;</b></font>
<font color="#ffff00"><b>19 </b></font>    <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author&gt;</b></font>
<font color="#ffff00"><b>20 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>21 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>insert-after</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for insert-after</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:author/atom:name</b></font>
<font color="#ffff00"><b>14 </b></font><font color="#00ffff"><b>       an atom:uri --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:author&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>    <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>17 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name</b></font><font color="#00ffff"><b>&gt;</b></font>James<font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name&gt;</b></font>
<font color="#ffff00"><b>18 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>uri</b></font><font color="#00ffff"><b>&gt;</b></font><a href="http://example.org/blogs/james">http://example.org/blogs/james</a><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>uri&gt;</b></font>
<font color="#ffff00"><b>19 </b></font>    <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author&gt;</b></font>
<font color="#ffff00"><b>20 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>21 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>insert-child</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for insert-child</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:author</b></font>
<font color="#ffff00"><b>14 </b></font><font color="#00ffff"><b>       an atom:uri --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:author&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>    <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>17 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name</b></font><font color="#00ffff"><b>&gt;</b></font>James<font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>name&gt;</b></font>
<font color="#ffff00"><b>18 </b></font>      <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>uri</b></font><font color="#00ffff"><b>&gt;</b></font><a href="http://example.org/blogs/james">http://example.org/blogs/james</a><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>uri&gt;</b></font>
<font color="#ffff00"><b>19 </b></font>    <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>author&gt;</b></font>
<font color="#ffff00"><b>20 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>21 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>remove</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for remove</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:author/atom:name --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>14 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:author/atom:name&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- yeah, this no atom:author is longer valid ..--</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>17 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>remove-all</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for remove</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:author/atom:name --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>14 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/*&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- yeah, this atom:entry is no longer valid ..--</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>17 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>set-attribute</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for set-attribute</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:link/@href </b></font>
<font color="#ffff00"><b>14 </b></font><font color="#00ffff"><b>       to <a href="http://not-example.org">http://not-example.org</a> --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:link/@href&quot;</b></font><font color="#00ffff"><b>&gt;</b></font><a href="http://not-example.org">http://not-example.org</a><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>16 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<h3>remove-attribute</h3>
<pre>
<font color="#ffff00"><b> 1 </b></font>PATCH /collection/entry/1 HTTP/1.1
<font color="#ffff00"><b> 2 </b></font>Host: example.org
<font color="#ffff00"><b> 3 </b></font>Content-Type: application/delta+xml
<font color="#ffff00"><b> 4 </b></font>Content-Length: nnnn
<font color="#ffff00"><b> 5 </b></font>
<font color="#ffff00"><b> 6 </b></font><font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta</b></font>
<font color="#ffff00"><b> 7 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>d</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://purl.org/atompub/delta">http://purl.org/atompub/delta</a>&quot;</b></font>
<font color="#ffff00"><b> 8 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b> 9 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>atom</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://www.w3.org/2005/Atom">http://www.w3.org/2005/Atom</a>&quot;</b></font>
<font color="#ffff00"><b>10 </b></font><font color="#00ffff"><b>  </b></font><font color="#00ff00"><b>xmlns</b></font><font color="#00ffff"><b>:</b></font><font color="#00ff00"><b>b</b></font>=<font color="#ff40ff"><b>&quot;<a href="http://example.org/foo">http://example.org/foo</a>&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>11 </b></font>
<font color="#ffff00"><b>12 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- substitute for remove-attribute</b></font>
<font color="#ffff00"><b>13 </b></font><font color="#00ffff"><b>       /atom:entry/atom:link/@href --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>14 </b></font>  <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace</b></font><font color="#00ffff"><b> </b></font><font color="#00ff00"><b>path</b></font>=<font color="#ff40ff"><b>&quot;/atom:entry/atom:link&quot;</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>15 </b></font>    <font color="#00ffff"><b>&lt;</b></font><font color="#ff6060"><b>atom</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>link</b></font><font color="#00ffff"><b>/&gt;</b></font>
<font color="#ffff00"><b>16 </b></font>  <font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>replace&gt;</b></font>
<font color="#ffff00"><b>17 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- you can't take the easy way and match</b></font>
<font color="#ffff00"><b>18 </b></font><font color="#00ffff"><b>       the attribute, because an empty attribute</b></font>
<font color="#ffff00"><b>19 </b></font><font color="#00ffff"><b>       (@attr=&quot;&quot;) means something different than</b></font>
<font color="#ffff00"><b>20 </b></font><font color="#00ffff"><b>       the absence of @attr --</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>21 </b></font>  <font color="#00ffff"><b>&lt;!</b></font><font color="#00ffff"><b>-- and this atom:link is longer valid ..--</b></font><font color="#00ffff"><b>&gt;</b></font>
<font color="#ffff00"><b>22 </b></font><font color="#00ffff"><b>&lt;/</b></font><font color="#ff6060"><b>d</b></font><font color="#00ffff"><b>:</b></font><font color="#00ffff"><b>delta&gt;</b></font>
</pre>
<p>I think the above could be fairly easily implemented as a transformation into either XQuery or XSLT, but I&#8217;d imagine that it could be implemented using streaming techniques as well. Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/06/10/partial-updates-a-simpler-strawman/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Code Behind DocBook Elements in the Wild</title>
		<link>http://kfahlgren.com/blog/2007/05/01/the-code-behind-docbook-elements-in-the-wild/</link>
		<comments>http://kfahlgren.com/blog/2007/05/01/the-code-behind-docbook-elements-in-the-wild/#comments</comments>
		<pubDate>Wed, 02 May 2007 03:24:15 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[AtomPub]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DocBook]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/05/01/the-code-behind-docbook-elements-in-the-wild/</guid>
		<description><![CDATA[[UPDATE: Added a link to the categorized CSV file below]
Here&#8217;s some of the nitty-gritty behind DocBook Elements in the Wild. We&#8217;re trying to get a count of all of the element names in a set of 49 DocBook 4.4 &#60;book&#62;s.
First, go ask the O&#8217;Reilly product database for all the books that were sent to the [...]]]></description>
			<content:encoded><![CDATA[<p>[UPDATE: Added a link to the <a href="http://kfahlgren.com/docbook/49books_categorized.csv">categorized CSV</a> file below]</p>
<p>Here&#8217;s some of the nitty-gritty behind <a href="http://www.oreillynet.com/xml/blog/2007/05/docbook_elements_in_the_wild.html">DocBook Elements in the Wild</a>. We&#8217;re trying to get a count of all of the element names in a set of 49 DocBook 4.4 <tt>&lt;book&gt;</tt>s.</p>
<p>First, go ask the O&#8217;Reilly product database for all the books that were sent to the printer in 2006. Because I&#8217;m better at XML than Unix text tools, ask for <tt>mysql -X</tt>. Now we&#8217;ve got something like:</p>
<pre>&lt;resultset statement="select..."&gt;
 &lt;row&gt;
        &lt;field name="isbn13"&gt;9780596101619&lt;/field&gt;
        &lt;field name="title"&gt;Google Maps Hacks&lt;/field&gt;
        &lt;field name="edition"&gt;1&lt;/field&gt;
        &lt;field name="book_vendor_date"&gt;2006-01-05&lt;/field&gt;
  &lt;/row&gt;
  &lt;row&gt;
        &lt;field name="isbn13"&gt;9780596008796&lt;/field&gt;
        &lt;field name="title"&gt;Excel Scientific and Engineering Cookbook&lt;/field&gt;
        &lt;field name="edition"&gt;1&lt;/field&gt;
        &lt;field name="book_vendor_date"&gt;2006-01-06&lt;/field&gt;
  &lt;/row&gt;
  &lt;row&gt;
        &lt;field name="isbn13"&gt;9780596101732&lt;/field&gt;
        &lt;field name="title"&gt;Active Directory&lt;/field&gt;
        &lt;field name="edition"&gt;3&lt;/field&gt;
        &lt;field name="book_vendor_date"&gt;2006-01-06&lt;/field&gt;
  &lt;/row&gt;
  ...
</pre>
<p>Next, fun with <a href="http://xmlstar.sourceforge.net/">XMLStarlet</a>:</p>
<pre>$ xml sel -t -m "//field[@name='isbn13']" -v '.' -n books_in_2006.xml
9780596101619
9780596008796
9780596101732
9780596009441
...</pre>
<p>Now, pull the content down from our <a href="http://www.ietf.org/internet-drafts/draft-ietf-atompub-protocol-14.txt">Atom Publishing Protocol</a> repository and make a big document with XIncludes:</p>
<pre>#!/usr/bin/env ruby
require 'kurt'
require 'rexml/document'
OUTFILE = "aggregate.xml"
files_downloaded = []
ARGV.each {|atom_id|
  entry = Atom::Entry.get_entry("#{Kurt::PROD_RESOURCES}/#{CGI.escape(atom_id)}")
  filename = atom_id.gsub(/\W/, '') + ".xml"
  File.open(filename, "w") {|f|
    f.print entry.content
  }
  files_downloaded &lt;&lt; filename
}

agg = REXML::Document.new
agg.add_element("books")
agg.root.add_namespace("xi", "http://www.w3.org/2001/XInclude")
files_downloaded.each {|file|
  xi = agg.root.add_element("xi:include")
  xi.add_attribute("href", file)
}
File.open(OUTFILE, "w") {|f|
  agg.write(f, 2)
}</pre>
<p>Resolve all of the XIncludes into one big file:</p>
<pre>$ xmllint --xinclude -o aggregate.xml aggregate.xml </pre>
<p>It&#8217;s now pretty huge (well, huge in my world):</p>
<pre>$ du -h aggregate.xml
102M    aggregate.xml</pre>
<p>At this point, we&#8217;re ready to do the real counting of the elements (slow REXML solution commented out in favor of a <a href="http://libxml.rubyforge.org/doc/">libxml</a>-based solution):</p>
<pre>#!/usr/bin/env ruby
require 'rexml/parsers/pullparser'
require 'rubygems'
require 'xml/libxml'
start = Time.now
ARGV.each {|filename|
  counts = Hash.new
#  parser = REXML::Parsers::PullParser.new(File.new(filename))
#  while parser.has_next?
#    el = parser.pull
#    if el.start_element?
#      element_name = el[0]
#      if counts[element_name]
#        counts[element_name] += 1
#      else
#        counts[element_name] = 1
#      end
#    end
#  end
  parser = XML::SaxParser.new
  parser.filename = filename
  parser.on_start_element {|element_name, _|
    if counts[element_name]
      counts[element_name] += 1
    else
      counts[element_name] = 1
    end
  }
  parser.parse

  File.open(filename + ".count.csv", "w") {|f|
    counts.each {|element_name, count|
      f.puts "\"#{element_name}\",#{count}"
    }
  }
}
</pre>
<p>(Hooray for steam parsing, as this 100MB file was cranked through in 27 seconds on a 700MHz box!)</p>
<p>Finally, we&#8217;ve got CSV and we can do some graphing. <a href="http://kfahlgren.com/docbook/49books.csv">Here&#8217;s the full CSV</a> and the <a href="http://kfahlgren.com/docbook/49books_categorized.csv">categorized CSV</a>. Rather than working on a code-based graphing solution, I just messed with Excel. The result:</p>
<p><a href="http://www.oreillynet.com/xml/blog/images/elements_in_49_books.png"><img src="http://www.oreillynet.com/xml/blog/images/elements_in_49_books.png" alt="DocBook Elements from 49 Books" /></a></p>
<p>Here&#8217;s my favorite, a drill-down based on a categorization I just made up (click through for the drill-down):</p>
<p><a href="http://kfahlgren.com/photos/docbook/49booksmap.html"><img src="http://kfahlgren.com/photos/docbook/elements_in_49_books_categorized.png" alt="DocBook Elements from 49 Books, Categorized" /></a></p>
<p>Books used:</p>
<ul>
<li><a href="http://www.oreilly.com/catalog/googlemapshks/">Google Maps Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/excelseckbk/">Excel Scientific and Engineering Cookbook, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/actdir3/">Active Directory, 3e</a></li>
<li><a href="http://www.oreilly.com/catalog/rfid/">RFID Essentials, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/vb2005ian3/">Visual Basic 2005 in a Nutshell, 3e</a></li>
<li><a href="http://www.oreilly.com/catalog/psphks/">PSP Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/baseballhks/">Baseball Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/mindperfhks/">Mind Performance Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/repairpc/">Repairing and Upgrading Your PC, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/websiteckbk/">Web Site Cookbook, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/flickrhks/">Flickr Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/accessannoy/">Fixing Access Annoyances, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/powerpointannoy/">Fixing PowerPoint Annoyances, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/progsqlsvr/">Programming SQL Server 2005, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/learncsharp2/">Learning C# 2005, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/photoshopraw/">Photoshop CS2 RAW, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/wdnut3/">Web Design in a Nutshell, 3e</a></li>
<li><a href="http://www.oreilly.com/catalog/googletmm2/">Google: The Missing Manual, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/dgbebay/">Don&#8217;t Get Burned on eBay, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/artofsql/">The Art of SQL, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/windowsxpannoy/">Fixing Windows XP Annoyances, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/iphotomm/">iPhoto 6: The Missing Manual, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/ipodtmm4/">iPod &#038; iTunes: The Missing Manual, 4e</a></li>
<li><a href="http://www.oreilly.com/catalog/ajaxhks/">Ajax Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/flash8tmm/">Flash 8: The Missing Manual, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/mysqlspp/">MySQL Stored Procedure Programming, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/flashprojects/">Flash 8: Projects for Learning Animation and Interactivity, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/xamlian/">XAML in a Nutshell, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/linuxannoygks/">Linux Annoyances for Geeks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/progphp2/">Programming PHP, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/flash8ckbk/">Flash 8 Cookbook, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/learnsqlsvr05/">Learning SQL on SQL Server 2005, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/progexcel/">Programming Excel with VBA and .NET, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/imovie06tmm/">iMovie 6 &#038; iDVD: The Missing Manual, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/enterprisesa/">Enterprise SOA, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/perlhks/">Perl Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/javaio2/">Java I/O, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/entjbeans5/">Enterprise JavaBeans 3.0, 5e</a></li>
<li><a href="http://www.oreilly.com/catalog/web2apps/">Building Scalable Web Sites, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/mcsecoreian/">MCSE Core Required Exams in a Nutshell, 3e</a></li>
<li><a href="http://www.oreilly.com/catalog/dns5/">DNS and BIND, 5e</a></li>
<li><a href="http://www.oreilly.com/catalog/learnphpmysql/">Learning PHP and MySQL, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/csb2/">Computer Security Basics, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/activedckbk2/">Active Directory Cookbook, 2e</a></li>
<li><a href="http://www.oreilly.com/catalog/ubuntuhks/">Ubuntu Hacks, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/unicode/">Unicode Explained, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/digphototmm/">Digital Photography: The Missing Manual, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/ajaxdp/">Ajax Design Patterns, 1e</a></li>
<li><a href="http://www.oreilly.com/catalog/pythonian2/">Python in a Nutshell, 2e</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/05/01/the-code-behind-docbook-elements-in-the-wild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Borrowing Java&#8217;s XSLT Support for Ruby</title>
		<link>http://kfahlgren.com/blog/2007/03/02/borrowing-javas-xslt-support-for-ruby/</link>
		<comments>http://kfahlgren.com/blog/2007/03/02/borrowing-javas-xslt-support-for-ruby/#comments</comments>
		<pubDate>Fri, 02 Mar 2007 20:56:50 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/03/02/borrowing-javas-xslt-support-for-ruby/</guid>
		<description><![CDATA[Well, I finally caught up with the crowd and got JRuby running on one of my dev boxes. The reason I&#8217;d been interested in it from the getgo was because Ruby lacks any support for internal XSLT processing. All those system()s were starting to get me down, especially as I&#8217;m trying to get a DocBook->PDF [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I finally caught up with the crowd and got <a href="http://jruby.codehaus.org/">JRuby</a> running on one of my dev boxes. The reason I&#8217;d been interested in it from the getgo was because Ruby lacks any support for internal XSLT processing. All those <tt>system()</tt>s were starting to get me down, especially as I&#8217;m trying to get a DocBook->PDF rendering webservice to be a lot faster. Much to my surprise, I was able to get simple transforms working in almost no time (thanks in part to lots of help). Without further ado, here&#8217;s a simple library for XSLT transforms using either <a href="http://xml.apache.org/xalan-j/">Xalan-J</a> or <a href="http://sourceforge.net/projects/saxon/">Saxon</a> (make sure you have the <tt>jar</tt>s for both in your <tt>CLASSPATH</tt>):</p>
<pre>require 'java'
module JXslt
  include_class "javax.xml.transform.TransformerFactory"
  include_class "javax.xml.transform.Transformer"
  include_class "javax.xml.transform.stream.StreamSource"
  include_class "javax.xml.transform.stream.StreamResult"
  include_class "java.lang.System"

  class XsltProcessor
    def transform(xslt,infile,outfile)
      transformer = @tf.newTransformer(StreamSource.new(xslt))
      transformer.transform(StreamSource.new(infile), StreamResult.new(outfile))
    end
  end # XsltProcessor
  class Saxon < XsltProcessor
    TRANSFORMER_FACTORY_IMPL = "net.sf.saxon.TransformerFactoryImpl"
    def initialize
      System.setProperty("javax.xml.transform.TransformerFactory", TRANSFORMER_FACTORY_IMPL)
      @tf = TransformerFactory.newInstance
    end
  end
  class Xalan < XsltProcessor
    TRANSFORMER_FACTORY_IMPL = "org.apache.xalan.processor.TransformerFactoryImpl"
    def initialize
      System.setProperty("javax.xml.transform.TransformerFactory", TRANSFORMER_FACTORY_IMPL)
      @tf = TransformerFactory.newInstance
    end
  end
end 

# if you wanted to run this from the command line, do something like
# $ jruby lib/jxslt.rb a.xsl in.xml out.xml
xalan = JXslt::Xalan.new
xalan.transform(*ARGV)
#saxon = JXslt::Saxon.new
#saxon.transform(*ARGV)
</pre>
<p>Big props to <a href="http://blog.earstu.org/">Charles</a> for helping me get going and writing the first version of the above.</p>
<p><tt>darcs get http://kfahlgren.com/code/lib/jxslt/</tt> or <a href="http://kfahlgren.com/code/lib/jxslt/jxslt.rb">jxslt.rb</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/03/02/borrowing-javas-xslt-support-for-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting FrameMaker MIF as XML, Reading Bookfiles</title>
		<link>http://kfahlgren.com/blog/2007/02/25/exploiting-framemaker-mif-as-xml-reading-bookfiles/</link>
		<comments>http://kfahlgren.com/blog/2007/02/25/exploiting-framemaker-mif-as-xml-reading-bookfiles/#comments</comments>
		<pubDate>Sun, 25 Feb 2007 16:38:49 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[FrameMaker]]></category>
		<category><![CDATA[MX]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/2007/02/25/exploiting-framemaker-mif-as-xml-reading-bookfiles/</guid>
		<description><![CDATA[[Read this for an introduction to what I'm talking about].
Now that we&#8217;ve got our FrameMaker documents in XML, how can we exploit their new format? One of the first things I did was to create new ways of reading (eventually changing) the simple data stored within them. This isn&#8217;t all that earth-shattering, but when you [...]]]></description>
			<content:encoded><![CDATA[<p>[Read <a href="http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-introduction/">this</a> for an introduction to what I'm talking about].</p>
<p>Now that we&#8217;ve got our FrameMaker documents in XML, how can we exploit their new format? One of the first things I did was to create new ways of reading (eventually changing) the simple data stored within them. This isn&#8217;t all that earth-shattering, but when you consider how difficult it is to find and change some values in the FrameMaker UI this is a big win. Where to start? Bookfiles.</p>
<p>To be able to apply stylesheets or data-collection tools to books (rather than individual files), I need to be able to collect a books components. So, convert your bookfile to MX (yeah, it works on bookfiles as well as chapter files), and search through it for one of the filenames you know is a part of the book (you&#8217;ll probably want to pretty-print the XML first). I get something like this:</p>
<pre>  &lt;BookComponent&gt;
    &lt;FileName&gt;`&amp;lt;c\&amp;gt;ch01'&lt;/FileName&gt;
    &lt;Unique&gt;27107&lt;/Unique&gt;
    &lt;StartPageSide&gt;StartRightSide&lt;/StartPageSide&gt;
    &lt;PageNumbering&gt;Restart&lt;/PageNumbering&gt;
    &lt;PgfNumbering&gt;Continue&lt;/PgfNumbering&gt;
    &lt;PageNumPrefix&gt;`'&lt;/PageNumPrefix&gt;
    &lt;PageNumSuffix&gt;`'&lt;/PageNumSuffix&gt;
    &lt;DefaultPrint&gt;Yes&lt;/DefaultPrint&gt;
    &lt;DefaultApply&gt;Yes&lt;/DefaultApply&gt;
  &lt;/BookComponent&gt;</pre>
<p>MX in this case has a pretty comprehensible structure, so we&#8217;ll need to grab a <tt>BookComponent/FileName</tt>, do a little text processing to remove the funky characters, and potentially append our MX file extension (I chose &#8220;.mx&#8221;). Here&#8217;s a very simple stylesheet to do just that:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="xml" indent="yes"/&gt;

  &lt;xsl:template match="@*|node()"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:template&gt;  

  &lt;xsl:template match="/"&gt;
    &lt;xsl:element name="components"&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/xsl:element&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template match="//BookComponent/FileName"&gt;
    &lt;xsl:param name="extension" select="'.mx'"/&gt;
    &lt;xsl:variable name="str-after"&gt;
      &lt;xsl:value-of select="substring-after(., '&gt;')"/&gt;
    &lt;/xsl:variable&gt;
    &lt;xsl:element name="component"&gt;
      &lt;xsl:value-of select="substring($str-after,
                                      1,
                                      string-length($str-after) - 1)"/&gt;
      &lt;xsl:value-of select="$extension"/&gt;
    &lt;/xsl:element&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;</pre>
<p>When you run that on a MX bookfile, you should see an output like this (note that the file extension is customizable above):</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;components&gt;
  &lt;component&gt;svcTOC.fm.mx&lt;/component&gt;
  &lt;component&gt;foreword.mx&lt;/component&gt;
  &lt;component&gt;ch00.mx&lt;/component&gt;
  &lt;component&gt;ch01.mx&lt;/component&gt;
  &lt;component&gt;ch02.mx&lt;/component&gt;
  &lt;component&gt;ch03.mx&lt;/component&gt;
  &lt;component&gt;ch04.mx&lt;/component&gt;
  &lt;component&gt;ch05.mx&lt;/component&gt;
  &lt;component&gt;ch06.mx&lt;/component&gt;
  &lt;component&gt;ch07.mx&lt;/component&gt;
  &lt;component&gt;ch08.mx&lt;/component&gt;
  &lt;component&gt;ch09.mx&lt;/component&gt;
  &lt;component&gt;appa.mx&lt;/component&gt;
  &lt;component&gt;appb.mx&lt;/component&gt;
  &lt;component&gt;appc.mx&lt;/component&gt;
  &lt;component&gt;appd.mx&lt;/component&gt;
  &lt;component&gt;appe.mx&lt;/component&gt;
  &lt;component&gt;svcIX.fm.mx&lt;/component&gt;
  &lt;component&gt;svcAPL.fm.mx&lt;/component&gt;
  &lt;component&gt;svcLOR.fm.mx&lt;/component&gt;
&lt;/components&gt;</pre>
<p>That&#8217;ll give us a nice structure to direct other processes to the individual component files.</p>
<p>The code is also available <a href="http://kfahlgren.com/code/mx/xslt/mxgetbookcomponents.xsl">here</a> or <tt>darcs get http://kfahlgren.com/code/mx/</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/02/25/exploiting-framemaker-mif-as-xml-reading-bookfiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby and the Atom Publishing Protocol</title>
		<link>http://kfahlgren.com/blog/2007/02/24/ruby-and-the-atom-publishing-protocol/</link>
		<comments>http://kfahlgren.com/blog/2007/02/24/ruby-and-the-atom-publishing-protocol/#comments</comments>
		<pubDate>Sat, 24 Feb 2007 15:53:40 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[AtomPub]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[nbrug]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/?p=38</guid>
		<description><![CDATA[I gave a short talk at the first North Bay Ruby Users Group last Thursday (Feb 15, 2007) about my recent work implementing an Atom Publishing Protocol library in Ruby. Here&#8217;s the presentation:

]]></description>
			<content:encoded><![CDATA[<p>I gave a short talk at the first <a href="http://nbrug.com">North Bay Ruby Users Group</a> last Thursday (Feb 15, 2007) about my recent work implementing an <a href="http://ietfreport.isoc.org/idref/draft-ietf-atompub-protocol/">Atom Publishing Protocol</a> library in Ruby. Here&#8217;s the presentation:</p>
<p><a href="http://kfahlgren.com/talks/ruby_app.pdf"><img src="http://kfahlgren.com/talks/ruby_app.thumb.png" alt="Thumbnail of my Ruby APP talk" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/02/24/ruby-and-the-atom-publishing-protocol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting FrameMaker MIF as XML, Back into MIF</title>
		<link>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-back-into-mif/</link>
		<comments>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-back-into-mif/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 20:24:31 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[FrameMaker]]></category>
		<category><![CDATA[MX]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/?p=35</guid>
		<description><![CDATA[[Read this for an introduction to what I'm talking about].
The first step of doing anything useful with MX is the ability to get back out into MIF. Thankfully, this is an entirely trivial job in XSLT.
[This code thanks to my boss, Andrew Savikas.]

&#60;?xml version="1.0"?&#62;
&#60;xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&#62;
  &#60;!-- author: Andrew Savikas, O'Reilly Media --&#62;

  [...]]]></description>
			<content:encoded><![CDATA[<p>[Read <a href="http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-introduction/">this</a> for an introduction to what I'm talking about].</p>
<p>The first step of doing anything useful with MX is the ability to get back out into MIF. Thankfully, this is an entirely trivial job in XSLT.</p>
<p>[This code thanks to my boss, <a href="http://www.oreillynet.com/pub/au/1848">Andrew Savikas</a>.]</p>
<pre>
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;!-- author: Andrew Savikas, O'Reilly Media --&gt;

  &lt;xsl:output method="text" encoding="ascii"/&gt;
  &lt;xsl:strip-space elements="_facet"/&gt;

  &lt;xsl:template match="/|MIF_ROOT"&gt;
    &lt;xsl:apply-templates/&gt;
  &lt;/xsl:template&gt;

&lt;!-- This template needs to remain flush left for correct output --&gt;
&lt;xsl:template match="_facet"&gt;
&lt;xsl:text&gt;
&lt;/xsl:text&gt;
&lt;xsl:apply-templates/&gt;
&lt;/xsl:template&gt;

  &lt;xsl:template match="*"&gt;
    &lt;xsl:text&gt;&amp;lt;&lt;/xsl:text&gt;
      &lt;xsl:value-of select="name()"/&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
    &lt;xsl:apply-templates/&gt;
    &lt;xsl:text&gt;&amp;gt;&lt;/xsl:text&gt;
    &lt;xsl:text&gt; &lt;/xsl:text&gt;
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</pre>
<p>The code is also available <a href="http://kfahlgren.com/code/mx/xslt/mx2mif.xsl">here</a> or <tt>darcs get http://kfahlgren.com/code/mx/</tt>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-back-into-mif/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting FrameMaker MIF as XML, Introduction</title>
		<link>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-introduction/</link>
		<comments>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-introduction/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 19:32:26 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[DocBook]]></category>
		<category><![CDATA[FrameMaker]]></category>
		<category><![CDATA[MX]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://kfahlgren.com/blog/?p=34</guid>
		<description><![CDATA[My O&#8217;Reilly colleague Andy Bruno has just written a pair of posts on converting FrameMaker&#8217;s MIF (link may be old/die) format into XML (henceforth &#8216;MX&#8217;). I&#8217;ll be writing a few posts outlining the ways in which we&#8217;ve leveraged MX at O&#8217;Reilly.
[Update: Series continues here with getting back into MIF, and reading bookfiles.]

Background
After helping to get [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://oreilly.com">O&#8217;Reilly</a> colleague <a href="http://left.subtree.org">Andy Bruno</a> has just written a <a href="http://left.subtree.org/2007/01/25/converting-mif-to-xml/">pair</a> of <a href="http://left.subtree.org/2007/01/31/converting-mif-to-xml-java-version/">posts</a> on converting <a href="http://www.adobe.com/products/framemaker/">FrameMaker&#8217;s</a> <a href="http://partners.adobe.com/public/developer/en/framemaker/MIF_Reference.pdf">MIF</a> (link may be old/die) format into XML (henceforth &#8216;MX&#8217;). I&#8217;ll be writing a few posts outlining the ways in which we&#8217;ve leveraged MX at O&#8217;Reilly.</p>
<p>[Update: Series continues here with <a href="http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-back-into-mif/">getting back into MIF</a>, and <a href="http://kfahlgren.com/blog/2007/02/25/exploiting-framemaker-mif-as-xml-reading-bookfiles/">reading bookfiles</a>.]</p>
<p><span id="more-34"></span></p>
<h3>Background</h3>
<p>After helping to get <a href="http://www.docbook.org/tdg/en/html/docbook.html">DocBook</a> <a href="http://tim.oreilly.com/articles/longview.html">off the ground</a> in the early 90s, the company moved away from DocBook toward FrameMaker in the late 90s. FrameMaker continues to be our standard page layout program today for the core series: Cookbooks, Animal books, and Hacks books. InDesign controls our <a href="http://www.oreilly.com/store/series/headfirst.html">graphically rich series</a> and we&#8217;ve recently started pushing DocBook heavily again thanks to the <a href="http://www.sagehill.net/docbookxsl/">DocBook-XSL</a> project (see the <a href="http://www.oreilly.com/catalog/9780596527310/"><em>Rails Cookbook</em></a>, <a href="http://www.oreilly.com/catalog/unicode/index.html"><em>Unicode Explained</em></a>, or future <a href="http://www.oreilly.com/store/series/sc.csp">Short Cuts</a> for examples using DocBook-XSL).</p>
<p>Getting our corpus of hundreds of past and present FrameMaker titles into a round-trippable XML format was the basis for a huge technological breakthrough in all of O&#8217;Reilly&#8217;s underlying book production software. Andy was not the first O&#8217;Reilly employee to work on two-way converters, but his work came at a time when the entire XML toolchain was finally reaching maturity.</p>
<h3>Uses</h3>
<p>Some examples of what we did with MX (some of which I&#8217;ll try to highlight in future posts):</p>
<dl>
<dt>Conversions</dt>
<dd>We rewrote every single conversion path (both into FrameMaker and out of it) around MX over the course of a year:</p>
<ul>
<li>Word to Frame (Word 2003 XML)</li>
<li>Frame to DocBook (using XSLT2)</li>
<li>Frame to Word (for new revisions)</li>
<li>DocBook to Frame [partway] (but this was scrapped in favor of DocBook-XSL)</li>
</ul>
</dd>
<dt>Templates</dt>
<dd>MX allowed us to transform our templates into spec documents describing in detail all of our default styles (this was invaluable writing our DocBook-XSL customization layer)</dd>
<dt>Data Queries</dt>
<dd>We built some proof-of-concept data gatherers (much like <a href="http://labs.oreilly.com">labs.oreilly.com</a>).</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://kfahlgren.com/blog/2007/02/03/exploiting-framemaker-mif-as-xml-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
