<?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>Divide and Conquer &#187; XML</title>
	<atom:link href="http://www.divideandconquer.se/tag/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.divideandconquer.se</link>
	<description>David's Software Development Blog</description>
	<lastBuildDate>Thu, 24 Jun 2010 13:47:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I recently missed the 10th birthday of XML</title>
		<link>http://www.divideandconquer.se/2008/02/15/i-recently-missed-the-10th-birthday-of-xml/</link>
		<comments>http://www.divideandconquer.se/2008/02/15/i-recently-missed-the-10th-birthday-of-xml/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 18:47:39 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/02/15/i-recently-missed-the-10th-birthday-of-xml/</guid>
		<description><![CDATA[The birthday on February 10th was celebrated with a blog post about the XML People.
I&#8217;d like to add that XML is something like an eccentric coworker who manages to get entangled in everyone else&#8217;s work, either by invitation, pushed from above, or sneaked in by someone who knows him or her.
]]></description>
			<content:encoded><![CDATA[<p>The birthday on February 10th was celebrated with a blog post about the <a href="http://www.tbray.org/ongoing/When/200x/2008/02/10/XML-People" onclick="pageTracker._trackPageview('/outgoing/www.tbray.org/ongoing/When/200x/2008/02/10/XML-People?referer=');">XML People</a>.</p>
<p>I&#8217;d like to add that XML is something like an eccentric coworker who manages to get entangled in everyone else&#8217;s work, either by invitation, pushed from above, or sneaked in by someone who knows him or her.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/02/15/i-recently-missed-the-10th-birthday-of-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating XPath expressions against XML schema</title>
		<link>http://www.divideandconquer.se/2008/02/15/validating-xpath/</link>
		<comments>http://www.divideandconquer.se/2008/02/15/validating-xpath/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 11:34:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/02/15/validating-xpath-expressions-against-xsml-schema/</guid>
		<description><![CDATA[I have come across a situation where I want to make sure that an XPath expression is valid for querying a document that conforms to a specific XML Schema. My first thought was: this must have been done before and I started googling. I found some discouraging discussions. One approach was to create a dummy [...]]]></description>
			<content:encoded><![CDATA[<p>I have come across a situation where I want to make sure that an XPath expression is valid for querying a document that conforms to a specific XML Schema. My first thought was: this must have been done before and I started googling. I found some discouraging discussions. One approach was to <a href="http://www.thescripts.com/forum/thread648523.html" onclick="pageTracker._trackPageview('/outgoing/www.thescripts.com/forum/thread648523.html?referer=');">create a dummy document from the schema</a> and then try to evaluate the XPath expression. Nice try, but not ideal.</p>
<p>The XPath expressions I want to validate are actually very simple: they are <a href="http://www.w3.org/TR/xpath#NT-AbsoluteLocationPath" onclick="pageTracker._trackPageview('/outgoing/www.w3.org/TR/xpath_NT-AbsoluteLocationPath?referer=');">absolute location paths</a> and so far I&#8217;ve only seen elements (including namespace prefix) as nodes. I was thinking of using the XPath parsing in REXML but that&#8217;s clearly overkill when the XPath expressions are so simple. Keep It Simple, Stupid! I wonder if such a validation could be written in an XSLT that traverses the XML Schema?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/02/15/validating-xpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RESTafari</title>
		<link>http://www.divideandconquer.se/2008/02/11/restafari/</link>
		<comments>http://www.divideandconquer.se/2008/02/11/restafari/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 16:02:00 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[WWW]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/02/11/restafari/</guid>
		<description><![CDATA[Reading Interoperability Wars &#8211; Episode 6 &#8211; Part 1 &#8211; Revenge of Babble just made me want to create a blog post with this title.
]]></description>
			<content:encoded><![CDATA[<p>Reading <a href="http://www.goland.org/revengeofbabble/" onclick="pageTracker._trackPageview('/outgoing/www.goland.org/revengeofbabble/?referer=');">Interoperability Wars &#8211; Episode 6 &#8211; Part 1 &#8211; Revenge of Babble</a> just made me want to create a blog post with this title.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/02/11/restafari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is &lt;xsl:text&gt; required in &lt;xsl:message&gt; or not?</title>
		<link>http://www.divideandconquer.se/2008/01/25/is-required-in-or-not/</link>
		<comments>http://www.divideandconquer.se/2008/01/25/is-required-in-or-not/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 11:41:22 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/01/25/is-required-in-or-not/</guid>
		<description><![CDATA[In an XSLT script I didn&#8217;t use &#60;xsl:text&#62; inside of &#60;xsl:message&#62;. It worked fine in xsltproc, but the Java XSLT implementation we use complained. What was wrong then? The text in an &#60;xsl:message&#62; was not inside an &#60;xsl:text&#62; element.
Bad code:
&#60;xsl:message&#62;Don't do like this&#60;/xsl:message&#62;
Good code:
&#60;xsl:message&#62;&#60;xsl:text&#62;Do like this&#60;/xsl:text&#62;&#60;/xsl:message&#62;
To avoid making the same mistake (or another) I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>In an XSLT script I didn&#8217;t use &lt;xsl:text&gt; inside of &lt;xsl:message&gt;. It worked fine in xsltproc, but the Java XSLT implementation we use complained. What was wrong then? The text in an &lt;xsl:message&gt; was not inside an &lt;xsl:text&gt; element.</p>
<p>Bad code:</p>
<pre>&lt;xsl:message&gt;Don't do like this&lt;/xsl:message&gt;</pre>
<p>Good code:</p>
<pre>&lt;xsl:message&gt;&lt;xsl:text&gt;Do like this&lt;/xsl:text&gt;&lt;/xsl:message&gt;</pre>
<p>To avoid making the same mistake (or another) I wanted to validate my XSL. Searching for &#8220;xslt.xsd&#8221; turned up <a href="http://www.w3.org/XML/2000/04schema-hacking/xslt.xsd" onclick="pageTracker._trackPageview('/outgoing/www.w3.org/XML/2000/04schema-hacking/xslt.xsd?referer=');">something that seems out-of-date</a>. Some further searching revealed the <a href="http://norman.walsh.name/2004/07/25/xslt20" onclick="pageTracker._trackPageview('/outgoing/norman.walsh.name/2004/07/25/xslt20?referer=');">Validating XSLT 2.0</a> article that include a link to xslt10.rnc. For some reason <a href="http://www.thaiopensource.com/relaxng/jing.html" onclick="pageTracker._trackPageview('/outgoing/www.thaiopensource.com/relaxng/jing.html?referer=');">Jing</a> didn&#8217;t recognize this file until I converted it to XML syntax with <a href="http://thaiopensource.com/relaxng/trang.html" onclick="pageTracker._trackPageview('/outgoing/thaiopensource.com/relaxng/trang.html?referer=');">Trang</a>. Unfortunately the above mistake was not caught by the RELAX NG schema either!</p>
<p>Actually, the <a href="http://www.w3schools.com/xsl/el_message.asp" onclick="pageTracker._trackPageview('/outgoing/www.w3schools.com/xsl/el_message.asp?referer=');">&lt;xsl:message&gt; example at w3schools.com</a> does not use &lt;xsl:text&gt; in their example, so maybe it is simply an implementation issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/01/25/is-required-in-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSLT hacker</title>
		<link>http://www.divideandconquer.se/2008/01/16/xslt-hacker/</link>
		<comments>http://www.divideandconquer.se/2008/01/16/xslt-hacker/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 13:54:49 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/01/16/xslt-hacker/</guid>
		<description><![CDATA[So far, this week has been a week of XSLT hacking. My favorite is probably the XSLT script that generates another XSLT script! :-)
At one point I wanted to copy the default namespace (xmlns=&#8230;) from the source document to the destination document.
I did like this to retrieve the URI for the default namespace. Maybe there [...]]]></description>
			<content:encoded><![CDATA[<p>So far, this week has been a week of XSLT hacking. My favorite is probably the XSLT script that generates another XSLT script! :-)</p>
<p>At one point I wanted to copy the default namespace (xmlns=&#8230;) from the source document to the destination document.</p>
<p>I did like this to retrieve the URI for the default namespace. Maybe there is a simpler way?</p>
<pre>&lt;xsl:variable name="uri" select="string(namespace::*[name(.) = ''])"/&gt;</pre>
<p>In order to set the default namespace I found the excellent  <a href="http://fgeorges.blogspot.com/2007/01/creating-namespace-nodes-in-xslt-10.html" onclick="pageTracker._trackPageview('/outgoing/fgeorges.blogspot.com/2007/01/creating-namespace-nodes-in-xslt-10.html?referer=');">Creating namespace nodes in XSLT 1.0</a> blog post. The most relevant part was this hack:</p>
<pre>&lt;xsl:attribute
  name="{ concat($prefix, ':dummy-for-xmlns') }"
  namespace="{ $uri }"&gt;
&lt;/xsl:attribute&gt;</pre>
<p>I&#8217;d also like to mention that <a href="http://www.thaiopensource.com/relaxng/jing.html" onclick="pageTracker._trackPageview('/outgoing/www.thaiopensource.com/relaxng/jing.html?referer=');">Jing</a> seems to work fine for validating an XML document against an XML schema definition (XSD).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/01/16/xslt-hacker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an Atom feed from a web page</title>
		<link>http://www.divideandconquer.se/2008/01/13/creating-an-atom-feed-from-a-web-page/</link>
		<comments>http://www.divideandconquer.se/2008/01/13/creating-an-atom-feed-from-a-web-page/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 13:18:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[WWW]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/01/13/creating-an-atom-feed-from-a-web-page/</guid>
		<description><![CDATA[Most of my time at the computer yesterday was spent working on an unofficial syndication of the broadcast archive for the Swedish radio show P3 Rytm.  It&#8217;s actually quite simple&#8230; :-)

Use curl to download the web page broadcast archive for the show
Use iconv to convert the page to UTF-8
Use tidy to convert HTML to [...]]]></description>
			<content:encoded><![CDATA[<p>Most of my time at the computer yesterday was spent working on an <a href="http://p3rytm.2good.nu/" onclick="pageTracker._trackPageview('/outgoing/p3rytm.2good.nu/?referer=');">unofficial syndication of the broadcast archive</a> for the Swedish radio show <a href="http://www.sr.se/p3/rytm" onclick="pageTracker._trackPageview('/outgoing/www.sr.se/p3/rytm?referer=');">P3 Rytm</a>.  It&#8217;s actually quite simple&#8230; :-)</p>
<ol>
<li>Use curl to download the web page broadcast archive for the show</li>
<li>Use iconv to convert the page to UTF-8</li>
<li>Use <a href="http://tidy.sourceforge.net/" onclick="pageTracker._trackPageview('/outgoing/tidy.sourceforge.net/?referer=');">tidy</a> to convert HTML to XHTML</li>
<li>Use sed to adjust some URLs</li>
<li>Use xsltproc and an XSLT script to transform the relevant parts of the web page to an XML that almost is an Atom feed</li>
<li>Use sed to convert the dates in the XML so they are in the right format. It&#8217;s now <a href="http://feedvalidator.org/check.cgi?url=http%3A//p3rytm.2good.nu/atom.xml" onclick="pageTracker._trackPageview('/outgoing/feedvalidator.org/check.cgi?url=http_3A//p3rytm.2good.nu/atom.xml&amp;referer=');">a proper Atom feed</a>.</li>
</ol>
<p><strong>Update</strong> Of course there are <a href="http://www.masternewmedia.org/news/2006/03/09/how_to_create_a_rss.htm" onclick="pageTracker._trackPageview('/outgoing/www.masternewmedia.org/news/2006/03/09/how_to_create_a_rss.htm?referer=');">several online services to automate this</a>. (Read the comments too.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/01/13/creating-an-atom-feed-from-a-web-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A generic XML visualization with Graphviz?</title>
		<link>http://www.divideandconquer.se/2008/01/09/a-generic-xml-visualization-with-graphviz/</link>
		<comments>http://www.divideandconquer.se/2008/01/09/a-generic-xml-visualization-with-graphviz/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 12:37:46 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2008/01/09/a-generic-xml-visualization-with-graphviz/</guid>
		<description><![CDATA[Why can&#8217;t I find an XSLT file that that converts any XML file to a Graphviz DOT file that visualizes elements and attributes? It&#8217;s almost like I&#8217;m beginning to doubt my Google &#8220;skillz&#8221;! I&#8217;ve found some scripts that are specially targeted to various XML-based formats, but no generic one. Maybe it&#8217;s so simple that I [...]]]></description>
			<content:encoded><![CDATA[<p>Why can&#8217;t I find an XSLT file that that converts any XML file to a Graphviz DOT file that visualizes elements and attributes? It&#8217;s almost like I&#8217;m beginning to doubt my Google &#8220;skillz&#8221;! I&#8217;ve found some scripts that are specially targeted to various XML-based formats, but no generic one. Maybe it&#8217;s so simple that I could have made it myself on the time I spent searching and writing this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2008/01/09/a-generic-xml-visualization-with-graphviz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Ant is regrettably (?) using XML</title>
		<link>http://www.divideandconquer.se/2007/12/13/ant/</link>
		<comments>http://www.divideandconquer.se/2007/12/13/ant/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 14:51:40 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Ant]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.divideandconquer.se/2007/12/13/memorable-quotes-from-the-original-author-of-apache-ant/</guid>
		<description><![CDATA[I&#8217;ve done some Apache Ant build file hacking today and that made me recall that the original author of Ant, James Duncan Davidson, actually regretted using XML as the file format.
Mysteriously missing from today&#8217;s world wide web, but fortunately captured by the Wayback Machine, the blog entry Ant and XML  is worth reading. The [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done some <a href="http://ant.apache.org/" onclick="pageTracker._trackPageview('/outgoing/ant.apache.org/?referer=');">Apache Ant</a> build file hacking today and that made me recall that the original author of Ant, James Duncan Davidson, actually regretted using XML as the file format.</p>
<p>Mysteriously missing from today&#8217;s world wide web, but fortunately captured by the Wayback Machine, the blog entry <a href="http://web.archive.org/web/20041217023752/http://x180.net/Journal/2004/03/31.html" onclick="pageTracker._trackPageview('/outgoing/web.archive.org/web/20041217023752/http_//x180.net/Journal/2004/03/31.html?referer=');">Ant and XML</a>  is worth reading. The entry is concluded like this:</p>
<blockquote><p> If I knew then what I knew now, I would have tried using a real scripting language, such as JavaScript via the Rhino component or Python via JPython, with bindings to Java objects which implemented the functionality expressed in todays tasks. Then, there would be a first class way to express logic and we wouldn&#8217;t be stuck with XML as a format that is too bulky for the way that people really want to use the tool.</p>
<p>Or maybe I should have just written a simple tree based text format that captured just what was needed to express a project and no more and which would avoid the temptation for people to want to build a Turing complete scripting environment out of Ant build files.</p>
<p>Both of these approaches would have meant more work for me at the time, but the result might have been better for the tens of thousands of people who use and edit Ant build files every day.</p>
<p>Hindsight is always 20/20.</p></blockquote>
<p>The &#8220;real scripting language&#8221; part sounds just like Ruby&#8217;s build program <a href="http://rake.rubyforge.org/" onclick="pageTracker._trackPageview('/outgoing/rake.rubyforge.org/?referer=');">Rake</a> and &#8220;a simple tree based text format&#8221; sounds very much like <a href="http://www.yaml.org/" onclick="pageTracker._trackPageview('/outgoing/www.yaml.org/?referer=');">YAML</a>, a format well worth considering for hierarchical data structures.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.divideandconquer.se/2007/12/13/ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
