<?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>Inasmuch as... &#187; XML</title>
	<atom:link href="http://inasmuch.as/category/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://inasmuch.as</link>
	<description>...Life&#039;s but a walking shadow</description>
	<lastBuildDate>Sat, 04 Feb 2012 13:21:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Schematron Testing Framework</title>
		<link>http://inasmuch.as/2011/12/21/schematron-testing-framework/</link>
		<comments>http://inasmuch.as/2011/12/21/schematron-testing-framework/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 09:07:49 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[Schematron]]></category>
		<category><![CDATA[XProc]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=1170</guid>
		<description><![CDATA[Inasmuch as a suite of Schematron tests contains many contexts where a bug in a document will make a Schematron assert fail or a report succeed, it follows that for any new test suite and any reasonably sized but buggy &#8230; <a href="http://inasmuch.as/2011/12/21/schematron-testing-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> a suite of Schematron tests contains many contexts where a bug in a document will make a Schematron <code>assert</code> fail or a <code>report</code> succeed, it follows that for any new test suite and any reasonably sized but buggy document set, there will straight away be many <code>assert</code> and <code>report</code> messages produced by the tests.  When that happens, how can you be sure your Schematron tests all worked as expected?  How can you separate the expected results from the unexpected?  What&#8217;s needed is a way to characterise the Schematron tests before you start as reporting only what they should, no more, and no less.</p>
<p>stf (<a title="stf on GitHub." href="https://github.com/MenteaXML/stf">https://github.com/MenteaXML/stf</a>) is a XProc pipeline that runs a Schematron test suite on test documents (that you create) and winnows out the expected results and report just the unexpected.  stf uses a processing instruction (PI) in each of a set of (typically, small) test documents to indicate the test&#8217;s expected <code>assert</code>s and <code>report</code>s: the expected results are ignored, and all you see is what&#8217;s extra or missing.  And when you have no more unexpected results from your test documents, you&#8217;re ready to use the Schematron on your real documents.<span id="more-1170"></span></p>
<h1>&lt;?stf?&gt; Processing Instruction</h1>
<p>The format of the PI is:</p>
<pre><code>&lt;?stf \s+ ( '#NONE' | ROLE ':' COUNT ( \s+ ROLE ':' COUNT )* ) ?&gt; </code></pre>
<p>where:</p>
<ul>
<li><code>stf</code>: PI target</li>
<li><code>#NONE</code>: No faild <code>assert</code> or successful <code>report</code> expected. Use with &#8216;go&#8217; tests that should not produce any <code>assert</code> or <code>report</code> messages. If running Schematron on the test produces any <code>assert</code>s or <code>report</code>s, they are reported as an error.</li>
<li><em>ROLE</em>: Token corresponding to <code>@role</code> value of an <code>assert</code> or a <code>report</code> in the Schematron. Schematron allows <code>@role</code> to be an arbitrary string, but restricting it to a single token makes it easier to deal with the PI using regular expressions rather than having to parse roles that may contain spaces.</li>
<li><em>COUNT</em>: Integer number of expected occurrences of failed <code>assert</code>s or successful <code>report</code>s with <code>@role</code> value matching <em>ROLE</em>. A mismatch between the expected and actual count is reported as an error. A <em>ROLE</em> starting with <code>#</code> does not have its count checked.</li>
<li><code>\s</code>: Whitespace character</li>
</ul>
<h1>Examples</h1>
<pre><code>&lt;?stf ERROR_FOO:2 ERROR_BAR:1 ?&gt; </code></pre>
<p>A failed <code>assert</code> or successful <code>report</code> with <code>role="ERROR_FOO"</code> is expected twice in the SVRL from the test document, and either with <code>role="ERROR_BAR"</code> is expected once.</p>
<pre><code>&lt;?stf ERROR_FOO:2 #ERROR_BAR:1 ?&gt; </code></pre>
<p>A failed <code>assert</code> or successful <code>report</code> with <code>role="ERROR_FOO"</code> is expected twice in the SVRL, and no <code>assert</code> or <code>report</code> with <code>role="ERROR_BAR"</code> is expected since <code>#</code> precedes <code>ERROR_BAR</code>.</p>
<pre><code>&lt;?stf #NONE ?&gt; </code></pre>
<p>No <code>assert</code> or <code>report</code> are expected for the current document.</p>
<h1>Usage</h1>
<p>stf requires Ant and Calabash. Calabash (as used here) requires Saxon. All three require Java.</p>
<ol>
<li>Set the properties in <code>properties.xml</code> to match your local setup.</li>
<li>Write the tests, including a <code>&lt;?stf?&gt;</code> processing instruction in each.<br />
One practice is to use a <code>tests</code> directory containing a <code>go</code> subdirectory for tests that are expected to produce no Schematron <code>assert</code> or <code>report</code> messages and a <code>nogo</code> subdirectory for tests that are expected to have errors, but you can organise them any way you like.</li>
<li>Run Ant<br />
You can run the <code>test.schematron</code> from <code>build.xml </code>directly:</p>
<pre>ant -f /path/to/stf/build.xml test.schematron</pre>
<p>or you can import the stf <code>build.xml</code> into your local <code>build.xml</code>:</p>
<pre>&lt;property name="stf.dir" location="/path/to/stf" /&gt;
&lt;import file="${stf.dir}/build.xml" /&gt;</pre>
<p>and run the <code>test.schematron</code> target, or you can import the stf <code>build.xml</code> and use the <code>&lt;test.schematron/&gt;</code> macro in a target in your local <code>build.xml</code>:</p>
<pre>&lt;target name="test"&gt;
  &lt;test.schematron /&gt;
  &lt;xspec xspec.xml="tests.xspec" /&gt;
&lt;/target&gt;</pre>
</li>
</ol>
<h1>Ant Properties</h1>
<ul>
<li><code>${schematron}</code>: Schematron file to test.</li>
<li><code>${tests.dir}</code>: Directory containing test files.</li>
<li><code>${calabash.jar}</code>: Location of Calabash jar.</li>
<li><code>${saxon.jar}</code>: Location of Saxon 9.2 (or later) jar.</li>
<li><code>${resolver.jar}</code>: Location of XML catalog resolver library.</li>
<li><code>${resolver.class}</code>: Class name of XML catalog resolver. Default is <code>org.apache.xml.resolver.tools.CatalogResolver</code>.</li>
</ul>
<h1>XProc Processor</h1>
<p>The pipeline currently depends on Calabash extensions.</p>
<p>The version of Calabash used in testing depended on Saxon 9.2 or later.</p>
<h2>Running (Not Testing) Schematron</h2>
<p>Ant build file also includes <code>schematron</code> macro and <code>run.schematron</code> target to make it easy to run Schematron on real files once you&#8217;re sure it works on your tests.</p>
<h2>License</h2>
<p>Licensed under the terms of a BSD license.</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/12/21/schematron-testing-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS for the hierarchically minded</title>
		<link>http://inasmuch.as/2011/09/27/css-for-the-hierarchically-minded/</link>
		<comments>http://inasmuch.as/2011/09/27/css-for-the-hierarchically-minded/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 09:38:06 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=827</guid>
		<description><![CDATA[Inasmuch as both HTML and XML markup – being descended from SGML – support a nested, hierarchical structure and as CSS allows, even promotes, a stream-of-consciousness style of coding, there can be a tension between the two approaches. To put &#8230; <a href="http://inasmuch.as/2011/09/27/css-for-the-hierarchically-minded/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> both HTML and XML markup – being descended from SGML – support a nested, hierarchical structure and as CSS allows, even promotes, a stream-of-consciousness style of coding, there can be a tension between the two approaches.</p>
<p>To put it another way:</p>
<ul>
<li>If you want different styles in a couple of contexts that depend on the type of several levels of ancestor, then you get to put all those ancestors in the CSS selectors for each of those styles;</li>
<li>If you want to use the same colour in multiple different styles, then, by golly, you get to enter the same <code>color</code> value in each of them (and if you want to change it later, you get to find them all again to do it); and</li>
<li>If you want to use the same set of styles in multiple contexts – say, use rounded corners multiple places and with bigger radii on the outermost corners – then you get to repeat the same set of styles while jiggering their values every place that you want them.</li>
</ul>
<p>The CSS soon gets to the point that only a machine can reliably work out the cascading and so we require tools such as <a title="Firebug: Web Development Evolved." href="http://getfirebug.com/">Firebug</a> to make sense of it and present it to us in ways that we can understand.</p>
<p>I have previously implemented a system for a client where the template CSS file is wrapped in an XML element and contains empty elements for each of the values of <code>color</code> properties so the all-XML processing system can &#8216;skin&#8217; the stylesheet by substituting the preferred <code>color</code> values and outputting proper CSS on the way to making the HTML, but that was adding complexity, not taking it away.</p>
<p>Enter LESS (<a title="LESS website" href="http://www.lesscss.org/">http://www.lesscss.org/</a>), the &#8220;dynamic stylesheet language&#8221;. LESS is pretty much CSS as it should have been, since it elegantly solves the gripes listed above, and more besides.<span id="more-827"></span></p>
<p>LESS is available as a JavaScript library for <a title="LESS client-side usage" href="http://www.lesscss.org/#-client-side-usage">client-side</a> translation of <code>.less</code> stylesheets â€“ linked from your HTML with the link&#8217;s <code>rel</code> attribute set to &#8220;<code>stylesheet/less</code>&#8221; â€“ into CSS on the fly and <a title="LESS server-side usage" href="http://www.lesscss.org/#-server-side-usage">server-side</a> for use with <a title="Node (a.k.a. 'node.js') website" href="http://nodejs.org/">Node</a>. It&#8217;s also available as a command-line program that simply converts LESS to CSS that you can save and serve statically.</p>
<p>There are good and succinct examples on the LESS website. Just to be different, here&#8217;s an example from my <a title="XML Summer School skin for S5" href="https://github.com/tkg/xmlss-s5">GitHub project</a> for an <a title="XML Summer School website" href="http://www.xmlsummerschool.com">XML Summer School</a> skin for <a title="'S5: A Simple Standards-Based Slide Show System' website" href="http://meyerweb.com/eric/tools/s5/">S5</a>.</p>
<p>Here&#8217;s a subset of an <a title="Old version of XML Summer School CSS" href="https://github.com/tkg/xmlss-s5/blob/d480044e71ea0b61ecfd82bf27e6f4ae7552013b/css/slides.css">old version</a> borrowing what was originally Norman Walsh&#8217;s CSS for his <a title="Norman Walsh's 'XML Summer School 2011 Slide Template' project on GitHub" href="https://github.com/ndw/xmlss-templates">project</a> for producing XHTML slides for XML Summer School:</p>
<pre>.footer {
    background-color: #fffc84;
    position: relative;
    background-image: url(../images/cc-1024.png);
    background-repeat: no-repeat;
    background-position: 3 3;
    margin-top: -48px; /* negative value of footer height */
    height: 48px;
    bottom: 0px;
    padding-left: 100px;
    clear: both;
}

.footer .content {
    padding-left: 400px;
    height: 0px;
}

.footer .license {
    padding-top: 8px;
    padding-left: 30px;
    font-size: 10pt;
    height: 0px;
}

.footer .foilnumber {
    text-align: right;
    padding-right: 30px;
    padding-top: 14px;
    font-size: 10pt;
    height: 0px;
}

pre {
    font-family: Courier New, Courier, monospaced;
    font-weight: bold;
    border: 1px solid black;
    padding: 10px;
}

.xml {
    background-color: #E6E6E6;
}

.xslt {
    background-color: #FFFDCE;
}

.schema {
    background-color: #E5E7FE;
}

.other {
    background-color: #C7FFFF;
    color: #9E0000;
}

.xml .pi {
    color: #8C35C7;
}

.xml .el {
    color: #001A94;
}

.xml .att {
    color: #FC7F4C;
}

.xml .attval {
    color: #9E2E00;
}

.xml .ent {
    color: #979315;
}

.xml .xslt {
    color: #006AC6;
}

pre .p {
    color: #9E0000;
}

pre .kw {
    color: #001A94;
}

pre .str {
    color: #595837;
}

pre .re {
    color: #FC7F4C;
}</pre>
<p>And here&#8217;s a <a title="Old, LESSified version of XML Summer School CSS" href="https://github.com/tkg/xmlss-s5/blob/73353ed454af621f28210e21c560e3cd7cc98b26/css/slides.css">old but LESSified version</a> of the same excerpt:</p>
<pre>@yellow: #fffc84;

.footer {
    background-color: @yellow;
    position: relative;
    background-image: url(../images/cc-1024.png);
    background-repeat: no-repeat;
    background-position: 3 3;
    margin-top: -48px; /* negative value of footer height */
    height: 48px;
    bottom: 0px;
    padding-left: 100px;
    clear: both;

    .content {
	padding-left: 400px;
	height: 0px;
    }

    .license {
	padding-top: 8px;
	padding-left: 30px;
	font-size: 10pt;
	height: 0px;
    }

    .foilnumber {
	text-align: right;
	padding-right: 30px;
	padding-top: 14px;
	font-size: 10pt;
	height: 0px;
    }
}

pre {
    font-family: Courier New, Courier, monospaced;
    font-weight: bold;
    border: 1px solid black;
    padding: 10px;

    &amp;.xml {
	background-color: #E6E6E6;

	.pi {
	    color: #8C35C7;
	}

	.el {
	    color: #001A94;
	}

	.att {
	    color: #FC7F4C;
	}

	.attval {
	    color: #9E2E00;
	}

	.ent {
	    color: #979315;
	}

	&amp;.xslt {
	    color: #006AC6;
	}
    }

    &amp;.xslt {
	background-color: #FFFDCE;
    }

    &amp;.schema {
	background-color: #E5E7FE;
    }

    &amp;.other {
	background-color: #C7FFFF;
    }

    .p {
	color: #9E0000;
    }

    .kw {
	color: #001A94;
    }

    .str {
	color: #595837;
    }

    .re {
	color: #FC7F4C;
    }
}</pre>
<p>Note that:</p>
<ul>
<li>The colour <code>@yellow</code> is also used elsewhere in the stylesheet, but I didn&#8217;t want to repeat the whole stylesheet here.</li>
<li>The <code>&amp;</code> combinator concatenates a nested selector to its parent selector instead of the selector acting as a descendent. As the LESS website <a title="'Nested rules' definition on LESS website" href="http://www.lesscss.org/#-nested-rules">notes</a>, this is especially important for pseudo-classes like <code>:hover</code> and <code>:focus</code>.</li>
<li>Code samples in the slides are represented with the <code>&lt;pre&gt;</code> element with a different background colour depending on the code type..</li>
<li>The class names for styling parts of XML markup in samples are common to both XML and XSLT samples. Since my project includes a stylesheet for translating Norm&#8217;s XHTML slide markup to S5-style XHTML, the class names are unchanged from the original and thus there&#8217;s a necessity for markup such as <code>&lt;pre class="xml xslt"&gt;</code> for getting the right colour for elements and attributes, etc., in XSLT code samples. If it weren&#8217;t for that, it would have been more sensible to use a LESS <a title="LESS mixins" href="http://www.lesscss.org/#-mixins">mixin</a> to handle the repetition between the XML and XSLT code sample styles.</li>
</ul>
<p>My only gripe with LESS so far is that I&#8217;ve yet to get it and the JavaScript from S5 to play nicely together, so I had to back out the use of LESS for the S5 project, which to date was my only publicly visible project to use LESS.</p>
<p>Arguably CSS1 could have introduced something more LESS (you just knew I&#8217;d been wanting to write that, didn&#8217;t you?) since <code>&lt;div&gt;</code> – the definitive expression of hierarchy in HTML content – was introduced in the HTML 3.0 drafts and CSS 1 <a title="CSS1 'References' section." href="http://www.w3.org/TR/REC-CSS1/#references">refers</a> to HTML 4.0. Hindsight, being the only perfect science, would indicate that is should have been possible, but I really don&#8217;t know whether it was technically or politically feasible once there was an installed base of CSS1 engines and web pages that used CSS1 as we knew it. If LESS does now catch on enough that it gets baked into browsers, this &#8216;native&#8217; LESS would probably require a different, <a title="Registered link relations at IANA" href="http://www.iana.org/assignments/link-relations/link-relations.xml">registered</a> <code>rel</code> value or a well-known MIME-type so there&#8217;s no conflict on the web pages that currently use LESS stylesheets with the LESS JavaScript library.</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/09/27/css-for-the-hierarchically-minded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Summer School 2011 ends on high note</title>
		<link>http://inasmuch.as/2011/09/26/xml-summer-school-2011-high-not/</link>
		<comments>http://inasmuch.as/2011/09/26/xml-summer-school-2011-high-not/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 08:46:59 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[xmlroff]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=888</guid>
		<description><![CDATA[Inasmuch as my final &#8220;XSLT and XSL-FO toolbox of tips and tricks&#8221; session was well received, XML Summer School 2011 finished on a high note. My other sessions, &#8220;Developing and Testing in XSLT&#8221; with Jeni Tennison in the &#8220;XSLT/XQuery&#8221; track &#8230; <a href="http://inasmuch.as/2011/09/26/xml-summer-school-2011-high-not/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> my final &#8220;XSLT and XSL-FO toolbox of tips and tricks&#8221; session was well received, <a title="XML Summer School website" href="http://xmlsummerschool.com/">XML Summer School 2011</a> finished on a high note. My other sessions, &#8220;Developing and Testing in XSLT&#8221; with <a title="Jeni Tennison bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-2011/#tennison">Jeni Tennison</a> in the &#8220;<a title="XML Summer School 2001 'XSLT/XQuery' track" href="http://xmlsummerschool.com/curriculum-2011/xslt-and-xquery-2011/">XSLT/XQuery</a>&#8221; track and a five-minute Ignite-format talk on EPUB, also went well, but it was that final talk in the &#8220;<a title="XML Summer School 2011 'Publishing' track" href="http://xmlsummerschool.com/curriculum-2011/publishing-2011/">Publishing</a>&#8221; track that got the most visible reactions.<span id="more-888"></span></p>
<p>Strangely, it was the existence of the <a title="xmlroff XSL formatter website" href="http://xmlroff.org">xmlroff</a> <a title="xmlroff testing module" href="http://xmlroff.org/wiki/TestingModule">testing module</a> that got several people most excited. I say &#8216;strangely&#8217; because I&#8217;ve been mentioning it in presentations for years (including three days earlier in the &#8220;XSLT/XQuery&#8221; track) without it seeming the stand-out feature of any of those talks, yet this time I had someone finding its URL and downloading it before I&#8217;d barely finished the slide about it. But I am in no way complaining.  It was good to see such a level of interest, and I hope it works out for him and the others. I&#8217;m also hoping to get some new feedback on how well it works, since although I&#8217;ve been using it (and tweaking it) for years, it doesn&#8217;t garner much feedback from other users.</p>
<p>My other reason for being pleased with the success of the XSLT and XSL-FO talk was that it meant that I&#8217;d kept to the high standard of the other talks in the track by <a title="Henry Thompson bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-2011/#thompson">Henry Thompson</a>, <a title="Norman Walsh bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-2011/#walsh">Norman Walsh</a>, and <a title="Sebastian Rahtz bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-2011/#rahtz">Sebastian Rahtz</a>. The talks in the &#8220;XSLT/XQuery&#8221; track by <a title="Priscilla Walmsley bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-board-2011/#walmsley">Priscilla Walmsley</a> (track chair) and <a title="Michael Kay bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-2011/#kay">Michael Kay</a> (and, as always, Jeni&#8217;s delivery) and the other Ignite talks were very good, too, but I thought the other &#8220;Publishing&#8221; track talks were particularly good. Quite an achievement considering that this was the first year that the XML Summer School had a separate &#8220;Publishing&#8221; track, so credit also goes to <a title="Peter Flynn bio for XML Summer School 2011" href="http://xmlsummerschool.com/faculty-board-2011/#flynn">Peter Flynn</a>, as track chair, for putting the track together in the first place.</p>
<p>I know the above reads like I&#8217;m in a <a title="'Mutual admiration society' at Wiktionary" href="https://secure.wikimedia.org/wiktionary/en/wiki/mutual_admiration_society">mutual admiration society</a>, but it really was a week of very good talks.</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/09/26/xml-summer-school-2011-high-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Summer School 2011</title>
		<link>http://inasmuch.as/2011/06/27/xml-summer-school-2011/</link>
		<comments>http://inasmuch.as/2011/06/27/xml-summer-school-2011/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 09:16:30 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[XMLSS]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=764</guid>
		<description><![CDATA[Inasmuch as I was already asked to be on the Publishing track at XML Summer School 2011, I was then invited to co-teach &#8220;DevelÂ­opÂ­ing and TestÂ­ing in XSLT&#8221; with Jeni Tennison in the XSLT and XQuery track, so I&#8217;m pleased &#8230; <a href="http://inasmuch.as/2011/06/27/xml-summer-school-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> I was already asked to be on the <a title="Publishing track at XML Summer School 2011" href="http://xmlsummerschool.com/curriculum-2011/publishing-2011/">Publishing</a> track at <a title="XML Summer School website" href="http://xmlsummerschool.com/">XML Summer School 2011</a>, I was then invited to co-teach &#8220;DevelÂ­opÂ­ing and TestÂ­ing in XSLT&#8221; with Jeni Tennison in the <a title="'XSLT and XQuery' track at XML Summer School 2011" href="http://xmlsummerschool.com/curriculum-2011/xslt-and-xquery-2011/">XSLT and XQuery</a> track, so I&#8217;m pleased that I&#8217;ll be teaching two sessions at the XML Summer School in St Edmund Hall, Oxford UniÂ­verÂ­sity, on 18-23 September 2011. (Early bird discount ends 30 June 2011.)</p>
<p>My sessions are but 1/4 of their respective tracks, but I&#8217;ll be in the room for the entirety of each track and, indeed, like all Faculty at the XML Summer School, I&#8217;ll be around all week.<span id="more-764"></span></p>
<p>For the record, the Publishing session is:</p>
<blockquote><p><strong>XSLT and XSL FO toolÂ­box of tips and tricks</strong></p>
<p>XSLT was designed to transÂ­form XML into other formats, and its oriÂ­ginal purÂ­pose was to transÂ­form XML into the XSL FO vocabÂ­uÂ­lary for formatÂ­ting asÂ pages.</p>
<p>ProÂ­duÂ­cing pages is still close to the heart of many pubÂ­lishÂ­ers, but we also use XSLT to transÂ­form XML into other XML vocubuÂ­larÂ­ies, into HTML, and into other non-XML formats.</p>
<p>This sesÂ­sion provides sample techÂ­niques for using XSLT and XSL FO in pubÂ­lishÂ­ing. We encourÂ­age attendees to put forÂ­ward their pain points with using XSLT and/or XSL FO,  either in the sesÂ­sion or beforeÂ­hand on the LinkedIn group  disÂ­cusÂ­sion, and weâ€™ll add them to the mix as we look at solvÂ­ing the XSLT and XSL FO probÂ­lems that matÂ­ter most to people.</p></blockquote>
<p>and the XSLT and XQuery session with Jeni Tennison is:</p>
<blockquote><p><strong>DevelÂ­opÂ­ing and TestÂ­ing in XSLT</strong></p>
<p>Unit tests, proÂ­filÂ­ing, debugÂ­ging and, increasÂ­ingly, test-driven develÂ­opÂ­ment are part of the bread and butÂ­ter of workÂ­ing with other proÂ­gramÂ­ming lanÂ­guages but are not always so with XSLT or XQuery.</p>
<p>In test-driven develÂ­opÂ­ment, which is a funÂ­daÂ­mental part of agile approaches to softÂ­ware develÂ­opÂ­ment, the developers write tests that describe the desired behaÂ­viour of their applicÂ­aÂ­tion, then write code that meets the tests. This style of develÂ­opÂ­ment keeps code focused, avoids breakÂ­ing existÂ­ing code and facilÂ­itÂ­ates refactoring.</p>
<p>In this sesÂ­sion, Jeni TenÂ­nison and Tony GraÂ­ham will describe both the state of the art in testÂ­ing and debugÂ­ging XSLT and XQuery and how test-driven develÂ­opÂ­ment applies to XSLT and XQuery develÂ­opÂ­ment. In parÂ­ticÂ­uÂ­lar, they will focus on the use of the XSpec testÂ­ing framework.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/06/27/xml-summer-school-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting RNG to RNC</title>
		<link>http://inasmuch.as/2011/06/24/converting-rng-to-rnc/</link>
		<comments>http://inasmuch.as/2011/06/24/converting-rng-to-rnc/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 22:51:54 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=739</guid>
		<description><![CDATA[Inasmuch as the customised version of the &#8220;xmlspec&#8221; schema being used for the next version of the XSL spec is maintained in RELAX NG XML syntax (RNG) and Emacs&#8217;s nXML-mode only uses RELAX NG compact syntax (RNC), I yet again &#8230; <a href="http://inasmuch.as/2011/06/24/converting-rng-to-rnc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> the customised version of the &#8220;xmlspec&#8221; schema being used for the next version of the XSL spec is maintained in <a title="MURATA Makoto's RELAX NG page." href="http://relaxng.org/">RELAX NG</a> XML syntax (RNG) and Emacs&#8217;s <a title="'nxml-mode' at emacswiki.org." href="http://www.emacswiki.org/emacs/NxmlMode">nXML-mode</a> only uses RELAX NG compact syntax (RNC), I yet again wanted to convert a schema from RNG to RNC.Â  As you would expect, there&#8217;s more than one way to do it.<span id="more-739"></span></p>
<p>The classic way is using James Clark&#8217;s utility.Â  This involves: (a) working out if you need <a title="Jing and Trang at Google Project Hosting." href="http://code.google.com/p/jing-trang/">&#8220;Jing&#8221; or &#8220;Trang&#8221;</a> (you need Trang); (b) getting the .jar or the executable; and (c) running it.Â  Fairly simple, though it&#8217;s a pain that although it&#8217;s bundled with Ubuntu, etc., it&#8217;s not installed by default.Â  I backup my data between OS re-installs (who doesn&#8217;t?) but not the OS-installed programs, so when I need it on a new machine or after a re-install, I, at least, have to go through the Jing/Trang confusion and then fire up the package manager to install it.</p>
<p>I wanted an alternative, but writing a RNG schema loader function for nxml-mode isn&#8217;t the work of an afternoon (interesting as it would be to bootstrap it using nxml-mode&#8217;s tokenizing of the RNG XML), so I found David Rosenborg&#8217;s &#8220;RNG to RNC Converter&#8221; (<a title="RNG to RNC converter download page." href="http://www.pantor.com/download.html">http://www.pantor.com/download.html</a>).Â  The current version works with XSLT 1.0 but not XSLT 2.0 (because it expects the XSLT processor to have a <code>node-set()</code> furnction), but you can add the following to <code>RngToRncProcessorConfig.xsl</code> so the XSLT works with both XSLT 1.0 and XSLT 2.0:</p>
<pre>&lt;!-- XSLT 2.0 or later. --&gt;
&lt;xsl:when test="system-property('xsl:version') &gt;= 2"&gt;
  &lt;xsl:variable name="body"&gt;
    &lt;xsl:for-each select="$schema"&gt;
      &lt;xsl:call-template name="make-body"/&gt;
    &lt;/xsl:for-each&gt;
  &lt;/xsl:variable&gt;
  &lt;xsl:sequence select="$body"/&gt;
&lt;/xsl:when&gt;
</pre>
<p>My only other quibble with the stylesheet is that it doesn&#8217;t preserve comments that are in the RNG (more straightforward to do in XSLT 2.0 than XSLT 1.0, I admit).</p>
<p>I don&#8217;t yet know if I&#8217;ll stick to using RNG to RNC Converter in preference to Trang.Â  The XSLT is easier to keep with the other stuff that I backup between installs or keep in the Subversion repository for machine configurations, but Trang is easier to use once it is installed and on your path.Â  The best thing is that now I have the choice of more than one way to do it.</p>
<p>For a more complete list of ways to do it that is maintained by MURATA Makoto, see <a title="Converters list at relaxng.org." href="http://relaxng.org/#conversion">http://relaxng.org/#conversion</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/06/24/converting-rng-to-rnc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xml-model processing instruction with nXML mode</title>
		<link>http://inasmuch.as/2011/05/25/xml-model-with-nxml-mode/</link>
		<comments>http://inasmuch.as/2011/05/25/xml-model-with-nxml-mode/#comments</comments>
		<pubDate>Wed, 25 May 2011 19:07:21 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=720</guid>
		<description><![CDATA[Inasmuch as the &#60;?xml-model?&#62; processing instruction (jointly developed by W3C and ISO/IEC JTC1/SC34) is the new, standard way to associate schemas with XML documents and I already had code for using a similar, oXygen-specific PI, it was easy to make &#8230; <a href="http://inasmuch.as/2011/05/25/xml-model-with-nxml-mode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> the <a title="xml-model Working Group Note" href="http://www.w3.org/TR/xml-model/"><code>&lt;?xml-model?&gt;</code></a> processing instruction (jointly developed by W3C and ISO/IEC JTC1/SC34) is the new, standard way to associate schemas with XML documents and I already had code for using a similar, oXygen-specific PI, it was easy to make a hook function to put in your .emacs file so nXML mode will use <code>&lt;?xml-model?&gt;</code> to find a RNC schema:<span id="more-720"></span></p>
<pre>(defun use-xml-model ()
  "Hook function for `nxml-mode' to use  PI for locating a
RNC schema."
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (if (search-forward "" nil t)
                           (match-beginning 0)))
                 (filename (save-excursion
                             (re-search-forward "href=\"\\([^\"]+\.rnc\\)\""
                                                pi-end t)
                             (match-string 1))))
;;            (message "pi-end: %d; filename: %s
;;                     pi-end filename)
            (if (and filename (file-readable-p filename))
                (rng-set-schema-file filename)))))))

(add-hook 'nxml-mode-hook
          'use-xml-model)</pre>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/05/25/xml-model-with-nxml-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XML Prague 2011 a success</title>
		<link>http://inasmuch.as/2011/03/31/xml-prague-2011-a-success/</link>
		<comments>http://inasmuch.as/2011/03/31/xml-prague-2011-a-success/#comments</comments>
		<pubDate>Thu, 31 Mar 2011 14:24:47 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=660</guid>
		<description><![CDATA[Inasmuch as the EPUB: Chapter and Verse talk went down well and, for many people, the Saturday evening libations at The Strahov Monastic Brevery went down even better, I judge XML Prague 2011 to be a success for me (and &#8230; <a href="http://inasmuch.as/2011/03/31/xml-prague-2011-a-success/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> the <em><a title="EPUB: Chapter and Verse" href="/2011/02/22/epub-chapter-and-verse/">EPUB: Chapter and Verse</a></em> talk went down well and, for many people, the <a title="XML Prague Night." href="http://www.xmlprague.cz/2011/xmlprague-night.html">Saturday evening</a> libations at <a title="The Strahov Monastic Brewery." href="http://www.klasterni-pivovar.cz/en/">The Strahov Monastic Brevery</a> went down even better, I judge <a title="XML Prague 2011" href="http://www.xmlprague.cz/2011/">XML Prague 2011</a> to be a success for me (and for my co-author, Mark Howe) and for Mentea and also a success in its own right.</p>
<p>Several people made approving comments about the talk, which was good (some even commented on last year&#8217;s talk, which, since this showed they still remembered it, was even better).Â  The best comment about this year&#8217;s though is probably <a title="@innovimax on Twitter" href="http://twitter.com/#!/innovimax">@Innovimax</a>&#8216;s <a title="Tweet by Innovimax." href="http://twitter.com/#!/innovimax/status/51942783677771776">tweet</a>:</p>
<blockquote><p>Tony is a real 21th century XML Monk! He sponsored the Beer Station at #xmlprague and works on nicely printing bibles. #consideringJoining</p></blockquote>
<p><span id="more-660"></span>(We did discuss his becoming a monk, of any order: I had considered that the asceticism aspect might be a problem, but he considered it to be a non-normative section of the specification.)</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/03/31/xml-prague-2011-a-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sponsoring XML Prague 2011</title>
		<link>http://inasmuch.as/2011/03/03/sponsoring-xml-prague-2011/</link>
		<comments>http://inasmuch.as/2011/03/03/sponsoring-xml-prague-2011/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 13:59:21 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[Company]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=651</guid>
		<description><![CDATA[Inasmuch as XML Prague was where it became obvious that &#8220;Menteith&#8221; wasn&#8217;t working for many people, Mentea is pleased to be sponsoring the evening libations at XML Prague 2011 to promote the new name.]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> XML Prague was where it became <a title="Need new company name" href="/2010/03/21/need-new-company-name/">obvious</a> that &#8220;Menteith&#8221; wasn&#8217;t working for many people, Mentea is pleased to be sponsoring the evening libations at <a title="XML Prague 2011" href="http://www.xmlprague.cz/2011/index.html">XML Prague 2011</a> to promote the new name.</p>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/03/03/sponsoring-xml-prague-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPUB: Chapter and Verse</title>
		<link>http://inasmuch.as/2011/02/22/epub-chapter-and-verse/</link>
		<comments>http://inasmuch.as/2011/02/22/epub-chapter-and-verse/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 08:15:40 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[EPUB]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=602</guid>
		<description><![CDATA[Inasmuch as XML Prague is the best XML conference in Europe that I know of, I am pleased to be again co-presenting with Mark Howe of Cyberporte at XML Prague 2011 on 26-27 March. Our talk this year is EPUB: &#8230; <a href="http://inasmuch.as/2011/02/22/epub-chapter-and-verse/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> XML Prague is the best XML conference in Europe that I know of, I am pleased to be again co-presenting with Mark Howe of <a title="Cyberporte" href="http://www.cyberporte.com">Cyberporte</a> at <a title="XML Prague 2011" href="http://www.xmlprague.cz/2011/index.html">XML Prague 2011</a> on 26-27 March. Our talk this year is <em>EPUB: Chapter and Verse</em>:</p>
<blockquote><p>The link between the Bible and publishing technology is at least as old as Gutenberg&#8217;s press. 400 years after the publication of the King James Bible, we were asked to convert five modern French Bible translations from a widely-used ad hoc TROFF-like markup scheme used to produce printed Bibles to a standard XML vocabulary, and then to EPUB. We opted to use XSLT 2.0 and ant to perform all stages of the conversion process. Along the way we discovered previously unimagined creativity in the original markup, even within a single translation. We cursed the medieval scholars and the modern editors who have colluded to produce several mutually incompatible document hierarchies. We struggled to map various typesetting features to EPUB. E-Reader compatibility made us nostalgic for browser wars of the 90s. The result is osisbyxsl, a soon-to-be open source solution for Bible EPUB origination.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2011/02/22/epub-chapter-and-verse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ant for EPUB</title>
		<link>http://inasmuch.as/2010/12/10/ant-for-epub/</link>
		<comments>http://inasmuch.as/2010/12/10/ant-for-epub/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 10:04:06 +0000</pubDate>
		<dc:creator>tkg</dc:creator>
				<category><![CDATA[XML]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[EPUB]]></category>

		<guid isPermaLink="false">http://inasmuch.as/?p=558</guid>
		<description><![CDATA[Inasmuch as I like to automate processes as much as possible, here&#8217;s two Ant targets/macros for automating zipping an EPUB file and checking it with epubcheck: Zipping an EPUB file so that it retains an uncompressed mimetype file &#60;target name="epub.zip" &#8230; <a href="http://inasmuch.as/2010/12/10/ant-for-epub/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-variant: small-caps;">Inasmuch as</span> I like to automate processes as much as possible, here&#8217;s two Ant targets/macros for automating zipping an EPUB file and checking it with <a title="EpubCheck is a tool to validate IDPF EPUB files." href="http://code.google.com/p/epubcheck/">epubcheck</a>:<span id="more-558"></span></p>
<ul>
<li>Zipping an EPUB file so that it retains an uncompressed <code>mimetype</code> file
<pre>&lt;target name="epub.zip"
        description="Package up an EPUB" &gt;
  &lt;delete file="${build.dir}/${epub}.epub" /&gt;
  &lt;!-- The 'mimetype' file is supposed to be uncompressed and the
       first thing in the .epub file so the file conforms to the
       (rather long) signature for EPUB files. --&gt;
  &lt;zip destfile="${build.dir}/${epub}.mimetype"
       compress="false"
       encoding="UTF-8"&gt;
    &lt;fileset dir="${build.dir}/${epub}" includes="mimetype" /&gt;
  &lt;/zip&gt;
  &lt;!-- We'd really rather have the rest compressed, thank you. --&gt;
  &lt;zip destfile="${build.dir}/${epub}.zip"
       compress="true"
       encoding="UTF-8"
       level="9"&gt;
    &lt;zipfileset dir="${build.dir}/${epub}/META-INF" prefix="META-INF"/&gt;
    &lt;zipfileset dir="${build.dir}/${epub}/OPS" prefix="OPS"/&gt;
  &lt;/zip&gt;
  &lt;!-- Putting them together this way is the best way so far found
       for getting only 'mimetype' uncompressed in the .epub. --&gt;
  &lt;zip destfile="${build.dir}/${epub}.epub"
       update="true"
       keepcompression="true"
       encoding="UTF-8"&gt;
    &lt;zipfileset src="${build.dir}/${epub}.mimetype" /&gt;
    &lt;zipfileset src="${build.dir}/${epub}.zip" /&gt;
  &lt;/zip&gt;
  &lt;!-- Delete the temporary Zip files. --&gt;
  &lt;delete file="${build.dir}/${epub}.mimetype" /&gt;
  &lt;delete file="${build.dir}/${epub}.zip" /&gt;
&lt;/target&gt;</pre>
</li>
<li>Checking an EPUB with <a title="EpubCheck is a tool to validate IDPF EPUB files." href="http://code.google.com/p/epubcheck/">epubcheck</a>
<pre>&lt;macrodef name="epub.check"
          description="Check an epub"&gt;
  &lt;attribute name="epub" description="Name of the EPUB" /&gt;
  &lt;sequential&gt;
    &lt;java jar="${epubcheck.jar}"
          fork="true"&gt;
      &lt;arg value="${build.dir}/@{epub}.epub" /&gt;
    &lt;/java&gt;
  &lt;/sequential&gt;
&lt;/macrodef&gt;

&lt;target name="epub.check.YourEPUB"
        description="Check YourEPUB EPUB"&gt;
  &lt;epub.check epub="YourEPUB"/&gt;
&lt;/target&gt;</pre>
<p>(In practice, the <code>epub.check.YourEPUB</code> target is generated by XSLT, but that&#8217;s another story.)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://inasmuch.as/2010/12/10/ant-for-epub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

