<?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>MicahLogic &#187; XQuery</title>
	<atom:link href="http://dubinko.info/blog/tags/standards/xquery-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://dubinko.info/blog</link>
	<description>From an XML geek, a reader, a writer, a connector, a man of the people (says keep hope alive)</description>
	<lastBuildDate>Thu, 02 Feb 2012 06:43:33 +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>Resurgence of MVC in XQuery</title>
		<link>http://dubinko.info/blog/2011/12/08/mvc-in-xquery/</link>
		<comments>http://dubinko.info/blog/2011/12/08/mvc-in-xquery/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 21:27:30 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[trends]]></category>
		<category><![CDATA[XForms]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XQuery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=956</guid>
		<description><![CDATA[There&#8217;s been an increasing amount of talk about MVC in XQuery, notably David Cassel&#8217;s great discussion and to an extent Kurt Cagle&#8217;s platform discussion that touched on forms interfaces. Lots of Smart People are thinking in this area, and that&#8217;s a good thing. A while back I recorded my thoughts on what I called MET, or [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been an increasing amount of talk about MVC in XQuery, notably David Cassel&#8217;s <a title="Models in XQuery" href="http://blog.davidcassel.net/2011/12/models-in-xquery/">great discussion</a> and to an extent Kurt Cagle&#8217;s <a title="The MarkLogic Platform" href="http://xmltoday.org/content/marklogic-platform">platform discussion</a> that touched on forms interfaces. Lots of Smart People are thinking in this area, and that&#8217;s a good thing.</p>
<p>A while back I recorded my thoughts on what I called MET, or the <a title="Model Endpoint Template" href="http://dubinko.info/blog/2009/11/29/model-endpoint-template/">Model Endpoint Template</a> organizational pattern, as used in MarkLogic Application Builder. One difference between 2009 and now, though, is that browsers have distanced themselves even farther from XML, which tends to undercut the eliminate-the-impedance-mismatch argument. In particular, the forms model in HTML5 continues to prefer flat data, which to me indicates that models still play an important role in XQuery web apps.</p>
<p>So I envision the app lifecycle like this:</p>
<ol>
<li>The browser requests a particular page, say the one that lets you configure sorting options in the app you’re building</li>
<li>An HTML page loads.</li>
<li>Client-side script requests the project state from a designated endpoint, the server transforms the XML into a flat list, and delivers it as JSON (as an optimization, the server can package the initial data into the page delivered in the prior step)</li>
<li>Standard form interaction and client-side scripting happens, including manipulation of repeating structures mediated by JavaScript</li>
<li>A standard form submit happens (possibly via script), sending a flat list back to the client, which performs an update to the stored XML.</li>
</ol>
<div>It&#8217;s pretty easy to envision data-mapping tools and libraries that help automate the construction of the transforms mentioned in steps 3 and 5.</div>
<p>Another thing that&#8217;s changed is the emergence of XQuery plugin technology in MarkLogic. There&#8217;s a rapidly-growing library of reusable components, initially centered around Information Studio but soon to cover more ground. This is going to have a major impact on XQuery app designs as components of the app (think visualization widgets) can be seamlessly added to apps.</p>
<p>Endpoints still make a ton of sense for XQuery apps, and provide the additional advantage that you now have a testable, concern-separated data layer for your app. Other apps have a clean way to interop, and even command-line operaton is possible with off-the-shelf-tools like wget.</p>
<p>Lastly, Templates. Even if you use plugins for the functional core of your app, there&#8217;s still a lot of boilerplate stuff you&#8217;d not want to repeat. Something like <a title="mustache.xq" href="http://developer.marklogic.com/code/mustache.xq">Mustache.xq</a> is a good fit for this.</p>
<p>Which is all good&#8211;but is it MVC? This organizational pattern (let&#8217;s call it MET 2.0) is a lot closer to it. Does MET need a controller? Probably. (MarkLogic now ships a pretty good one called rest:rewrite) Like MVC, MET separates the important essences of your application. XQuery will never be Ruby or Java, and its frameworks will never be Rails or Spring, but rather something uniquely poised to capture the expressive power of the language to build apps on top of unstructured and big data. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2011/12/08/mvc-in-xquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mark Logic User Conference 2010</title>
		<link>http://dubinko.info/blog/2010/02/22/mark-logic-user-conference-2010/</link>
		<comments>http://dubinko.info/blog/2010/02/22/mark-logic-user-conference-2010/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 23:52:39 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[chrisanderson]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[econtent]]></category>
		<category><![CDATA[marklogic]]></category>
		<category><![CDATA[michellemanafy]]></category>
		<category><![CDATA[registration]]></category>
		<category><![CDATA[starwars]]></category>
		<category><![CDATA[wired]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=797</guid>
		<description><![CDATA[Are you coming? Link. It starts on May 4 (Star Wars day!) at the InterContinental Hotel in San Francisco. Guest speakers include Chris Anderson, Editor-in-Chief of Wired and Michelle Manafy, Editor-in-Chief of EContent magazine. Early bird registration ends Feb 28. -m]]></description>
			<content:encoded><![CDATA[<p>Are you coming? <a href="http://www.marklogic.com/UserConference2010/">Link</a>. It starts on May 4 (Star Wars day<a title="May the 4th be with you" href="http://">!</a>) at the InterContinental Hotel in San Francisco. Guest speakers include Chris Anderson, Editor-in-Chief of Wired and Michelle Manafy, Editor-in-Chief of EContent magazine.</p>
<p>Early bird registration ends Feb 28. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2010/02/22/mark-logic-user-conference-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Model Endpoint Template (MET) organizational pattern for XRX apps</title>
		<link>http://dubinko.info/blog/2009/11/29/model-endpoint-template/</link>
		<comments>http://dubinko.info/blog/2009/11/29/model-endpoint-template/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 21:09:08 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[XForms]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[application builder]]></category>
		<category><![CDATA[endpoint]]></category>
		<category><![CDATA[marklogic]]></category>
		<category><![CDATA[met]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[xquery]]></category>
		<category><![CDATA[xrx]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=730</guid>
		<description><![CDATA[One of the lead bullets describing why XForms is cool always mentions that it is based on a Model View Controller framework. When building a full XRX app, though, MVC might not be the best choice to organize things overall. Why not? Consider a typical XRX app, like MarkLogic Application Builder. (You can download a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the lead bullets describing why <a title="XForms Institute" href="http://xformsinstitute.com">XForms</a> is cool always mentions that it is based on a Model View Controller framework. When building a full <a href="http://en.wikibooks.org/wiki/XRX">XRX</a> app, though, <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC</a> might not be the best choice to organize things overall. Why not?</p>
<p>Consider a typical XRX app, like MarkLogic Application Builder. (You can download a your copy of MarkLogic, including Application Builder, under the community license at the <a href="http://developer.marklogic.com/download/">developer site</a>.) For each page, the cycle goes like this:</p>
<ol>
<li>The browser requests a particular page, say the one that lets you configure sorting options in the app you&#8217;re building</li>
<li>The page loads, including client-side <a href="http://sourceforge.net/projects/xsltforms/">XForms via JavaScript</a></li>
<li>XForms requests the project state as XML from a designated endpoint; this becomes the XForms Instance Data</li>
<li>Stuff happens on the page that changes the client-side state</li>
<li>Just before leaving the page, XML representing the updated state is HTTP PUT back to the endpoint</li>
</ol>
<p>The benefit of this approach is that you are dealing with XML all the way through, no impedance mismatches like you might find on an app that awkwardly transitions from (say) relational data to Java objects to urlencoded name/value pairs embedded in HTML syntax.</p>
<p>So why not do this in straight MVC? Honestly, MVC isn&#8217;t a bad choice, but it can get unwieldy. If an endpoint consists of a separate model+view+controller files, and each individual page consists of separate model+view+controller files, it adds up to a lot of stuff to keep track of. In truly huge apps, this much attention to organization might be worth it, but most apps aren&#8217;t that big. Thus the MET pattern.</p>
<p>Model: It still makes sense to keep the code that deals with particular models (closely aligned with Schemas) as a separate thing. All of Application Builder, for example, has only one model.</p>
<p>Endpoint: The job of an endpoint is to GET and PUT (and possibly POST and DELETE) XML, or other equivalent resource bundles depending on how many media types you want to deal with. It combines an aspect of controllers by being activated by a particular URL and views by providing the data in a consistent format.</p>
<p>Template: Since XForms documents already contain MVC mechanics, it not a high-payoff situation to further use MVC to construct the XForms and XHTML wrapper themselves. The important stuff happens within XForms, and then you need various templating mechanisms for example to provide consistent headers, footers, and other pieces across multiple pages. For this, an ordinary templating mechanism suffices. I can imagine dynamic assembly scenarios where this wouldn&#8217;t be the case, but again, many apps don&#8217;t need this kind of flexibility, and the complexity that comes along with it.</p>
<p>What about separation of concerns? Oh yeah, what about it? :-) Technically both Endpoints and Templates violate classical <acronym title="separation of concerns">SOC</acronym>. In an XRX app, this typically doesn&#8217;t lead to the kinds of spaghetti situations that it might otherwise. Endpoints are self contained, and can focus on doing just one thing well; with limited scope comes limited ability to get into trouble. For those times when you need to dig into the XQuery code of an endpoint, it&#8217;s actually helpful to see both the controller and view pieces laid out in one file.</p>
<p>As for Templates, simplicity wins. With the specifics of models and endpoints peeled away, the remaining challenge in developing individual pages is getting the XForms right, and again, it&#8217;s helpful to minimize the numbers of files one XForms page are split across. <a title="You ain't gonna need it" href="http://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it">YAGNI</a> applies to what&#8217;s left, at least in the stuff I&#8217;ve built.</p>
<p>So, I&#8217;ve been careful in the title to call this an &#8220;organizational pattern&#8221;, not a &#8220;design pattern&#8221; or an (ugh) &#8220;architectural pattern&#8221;. Nothing too profound here. I&#8217;d be happy to start seeing XRX apps laid out with directory names like &#8220;models&#8221;, &#8220;endpoints&#8221;, and &#8220;templates&#8221;.</p>
<p>What do you think? Comments welcome.</p>
<p>-m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2009/11/29/model-endpoint-template/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Application Builder behind-the-scenes</title>
		<link>http://dubinko.info/blog/2009/10/21/application-builder-behind-the-scenes/</link>
		<comments>http://dubinko.info/blog/2009/10/21/application-builder-behind-the-scenes/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:04:43 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[XForms]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[hof]]></category>
		<category><![CDATA[novamug]]></category>
		<category><![CDATA[relax]]></category>
		<category><![CDATA[relaxng]]></category>
		<category><![CDATA[speaking]]></category>
		<category><![CDATA[xquery]]></category>
		<category><![CDATA[xrx]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=680</guid>
		<description><![CDATA[I&#8217;ll be speaking next Tuesday (Oct 27) at the Northern Virginia MarkLogic User Group (NOVAMUG). Here&#8217;s what I&#8217;ll be talking about. Application Builder consists of two main parts: Search API to enable Google-style search string processing, and the actual UI wizard that steps users through building a complete search app. It uses a number of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll be speaking next Tuesday (Oct 27) at the Northern Virginia MarkLogic User Group (NOVAMUG). Here&#8217;s what I&#8217;ll be talking about.</p>
<p>Application Builder consists of two main parts: Search API to enable Google-style search string processing, and the actual UI wizard that steps users through building a complete search app. It uses a number of technologies that have not (at least not up until now!) been widely associated with MarkLogic. <em>Why</em> some technologies that seem like a perfect fit for XML apps are less used in the Mark Logic ecosystem is anyone&#8217;s guess, but one thing App Builder can contribute to the environment is some fresh DNA. Maybe your apps can benefit from these as well.</p>
<p><strong>XForms and XRX</strong>. Clicking through the screens of App Builder is really a fancy way of editing XML. Upon first arriving on a page, the client makes a GET request to an &#8220;Application XML Endpoint&#8221; (axe.xqy) to get the current state of the project, which is rendered in the user interface. Interacting with the page edits the in-memory XML. Afterwards, the updated state is PUT back to the same endpoint upon clicking &#8216;Save&#8217; or prior to navigating away. This is a classic XRX architecture. MarkLogic ships with a copy of the <a href="http://sourceforge.net/projects/xsltforms/">XSLTForms</a> engine, which makes use of client-side XSLT to transform XForms Markup into divs, spans, classes, and JavaScript that can be processed entirely in the browser. Thus XForms works on all supported browsers all the way back to IE6. The apps built by the App Builder don&#8217;t use any XForms (yet!) but as App Builder itself demonstrates, it is a great platform for application development.</p>
<p>To be honest, many XForms apps have fallen short on the polished UI department. Not so with App Builder, IMHO. An early, and in hindsight somewhat misdirected, thrust of XForms advocacy pushed the angle of building apps with zero script needed. But one advantage of using a JavaScript implementation of XForms is that it frees you to use script as needed. So in many places, large amounts of UI, all mapped to XML, are able to be hidden away with CSS, and selectively revealed (or mapped to yet other HTML form controls) in small, self-contained overlays triggered via script. While it doesn&#8217;t fulfill the unrealistic promise of completely eliminating script, it&#8217;s a useful technique, one I predict we&#8217;ll see more of in the future.</p>
<p><strong>Relax NG</strong>. XML Schema has its roots deep into the XML infrastructure. The type system of XQuery and XSLT 2.0 is based on it. Even XForms has ties to it. But for its wide reach, XML Schema 1.0 has some maddening limitations, and &#8220;takes some getting used to&#8221; before one can sight read it. In the appendices of many recent W3C specifications use the highly-readable compact syntax to describe content models is a way equally human and machine-readable.</p>
<p>What are these limitations I speak of? XML Schema 1.1 goes a long way toward resolving these, but isn&#8217;t yet widely in use. Take this example, the content model of the &lt;options&gt; element from Search API:</p>
<pre>start = Options | Response

# Root element
OptionsType = (
 AdditionalQuery? &amp;
 Annotation* &amp;
 ConcurrencyLevel? &amp;
 Constraint* &amp;
 Debug? &amp;
 DefaultSuggestionSource? &amp;
 Forest* &amp;
 Grammar? &amp;
 Operator* &amp;
 PageLength? &amp;
 QualityWeight? &amp;
 ReturnConstraints? &amp;
 ReturnFacets? &amp;
 ReturnMetrics? &amp;
 ReturnQtext? &amp;
 ReturnQuery? &amp;
 ReturnResults? &amp;
 ReturnSimilar? &amp;
 SearchOption* &amp;
 SearchableExpression? &amp;
 SortOrder* &amp;
 SuggestionSource* &amp;
 Term? &amp;
 TransformResults?
)</pre>
<p>The start line indicates that, within this namespace, there are two possible root elements, either &lt;options&gt; or &lt;response&gt; (not shown here). An instance with a root of, say search:annotation is by definition not valid. Try representing that in XML Schema.</p>
<p>The definition of OptionsType allows a wide variety of child elements, some zeroOrMore times, other optional (zero or one occurrence), with no ordering restrictions at all between anything. XML Schema can&#8217;t represent this either. James Clark&#8217;s trang tool converts Relax NG into XML Schema, and has to approximate this as an xsd:choice with maxOccurs=&#8221;unbounded&#8221;, thus the elements that can only occur once are not schema-enforced. Thus the Relax NG description of the content model, besides being more readable, actually contains more information than the closest XML Schema. So particularly for XML vocabularies that are optimized for human use, Relax NG is a good choice for schema development.</p>
<p><strong>Out of line validation.</strong> So if XML Schema doesn&#8217;t fully describe the &lt;options&gt; node, how can authors be sure they have constructed one correctly? Take a step back: even if XML Schema could fully represent the content model, for performance reasons you wouldn&#8217;t want to repeatedly validate the node on every query. The options node tends to change infrequently, mainly during a development cycle. Both of these problems can be solved with out-of-line validation: a separate function call search:check-options().</p>
<p>Inside this function you&#8217;ll find a validate expression that will make as much use of the Schema as it can, but also much more. The full power of XQuery can be leveraged against the proposed &lt;options&gt; node to check for errors or inconsistencies, and provide helpful feedback to the developer. Since it happens out-of-line, these checks can take substantially longer than actually handing the query based on them. The code can go as in-depth as it needs to without performance worries. This is a useful technique in many situations. One potential shortfall is that people might forget to call your validation function, but in practice this hasn&#8217;t been too much trouble.</p>
<p><strong>Higher-order functions</strong>. The predecessor to Search API had a problem that it was so popular that users would modify it to suit their unique requirements, which lead to dozens of minor variations floating around in the wild. Different users have different needs and expectations for the library, and making a one-size-fits-all solution is perhaps not possible. One way to relieve this kind of feature pressure is to provide enough extension hotspots to allow all the kinds of tweaks that users will want, preserving the mainline code. This involves prediction, which is difficult (especially about the future). But a good design makes this possible.</p>
<p>Look inside the built-app and you will find a number of function pointers, implemented as a new datatype xdmp:function. XQuery 1.1 will have a more robust mechanism for this, but it might be a while before this is widespread. By modifying one file, changing a pointer to different code, nearly every aspect of the application can be adjusted.</p>
<p>Similarly, a few hotspots in the Search API can be customized, to hook in different kinds of parsers or snippet-generators. This powerful technique can take your own apps to the next level.</p>
<p>-m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2009/10/21/application-builder-behind-the-scenes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>EXPath.org</title>
		<link>http://dubinko.info/blog/2009/04/24/expathorg/</link>
		<comments>http://dubinko.info/blog/2009/04/24/expathorg/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 05:34:53 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[expath]]></category>
		<category><![CDATA[exslt]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[xpath]]></category>
		<category><![CDATA[xproc]]></category>
		<category><![CDATA[xquery]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=501</guid>
		<description><![CDATA[I&#8217;ve always thought that the EXSLT model of developing community specifications worked well. Now a critical mass of folks has come together on a similar effort, aimed at providing extensions usable in XPath 2.0, XSLT 2.0, XQuery, and other XPath-based languages like XProc. Maybe even XForms. Check it out, subscribe to the mailing list, and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always thought that the EXSLT model of developing community specifications worked well. Now a critical mass of folks has come together on a similar effort, aimed at providing extensions usable in XPath 2.0, XSLT 2.0, XQuery, and other XPath-based languages like XProc. Maybe even XForms.</p>
<p>Check it out, subscribe to the mailing list, and help out if you can. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2009/04/24/expathorg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crane Softwrights adds XQuery training</title>
		<link>http://dubinko.info/blog/2009/02/16/crane-softwrights-adds-xquery-training/</link>
		<comments>http://dubinko.info/blog/2009/02/16/crane-softwrights-adds-xquery-training/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 22:31:09 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[crane]]></category>
		<category><![CDATA[softwrights]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xmlprague]]></category>
		<category><![CDATA[xquery]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=433</guid>
		<description><![CDATA[From the company home page, reknown XSLT trainer and friend G. Ken Holman has expanded his offerings to include XQuery training. The first such session is March 16-20, alongside XML Prague. I&#8217;ve always thought there is great power in having both XSLT and XQuery tools at one&#8217;s disposal. I&#8217;ve seen people tend to polarize into [...]]]></description>
			<content:encoded><![CDATA[<p>From the company <a href="http://cranesoftwrights.com/">home page</a>, reknown XSLT trainer and friend G. Ken Holman has expanded his offerings to include XQuery training. The first such session is March 16-20, alongside <a href="http://www.xmlprague.cz/index.html">XML Prague</a>.</p>
<p>I&#8217;ve always thought there is great power in having both XSLT and XQuery tools at one&#8217;s disposal. I&#8217;ve seen people tend to polarize into one camp or the other, but in truth there is a lot of common ground, as well as cases where the right technology makes for a much more elegant solution. So learning both is easier than it seems, and more useful than it seems.</p>
<p>If you will be around the conference, take a look at the <a href="http://cranesoftwrights.com/training/ptuxq/ptuxqsyl.htm">syllabus</a>. I&#8217;m curious to see others&#8217; reactions toward the combined XSLT + XQuery toolset. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2009/02/16/crane-softwrights-adds-xquery-training/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XML 2008 liveblog: Introduction to eXist and XQuery</title>
		<link>http://dubinko.info/blog/2008/12/11/xml-2008-liveblog-introduction-to-exist-and-xquery/</link>
		<comments>http://dubinko.info/blog/2008/12/11/xml-2008-liveblog-introduction-to-exist-and-xquery/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 04:24:03 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[xml]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[exist]]></category>
		<category><![CDATA[marklogic]]></category>
		<category><![CDATA[xml2008]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=399</guid>
		<description><![CDATA[Greg Watson, IT Specialist, Defense Intelligence Agency Missile and Space Intelligence Center (apparently it IS rocket science). I installed eXist last night to follow along with the talk. &#8220;If you have a larger dataset, eXist may not be the best choice.&#8221; Recommended reading: XQuery by Priscilla Walmsley, XQuery wikibook. Download and install. Needs a full [...]]]></description>
			<content:encoded><![CDATA[<p>Greg Watson, IT Specialist, Defense Intelligence Agency Missile and Space Intelligence Center (apparently it IS rocket science). I installed eXist last night to follow along with the talk.</p>
<p>&#8220;If you have a larger dataset, eXist may not be the best choice.&#8221; Recommended reading: <a href="http://www.amazon.com/exec/obidos/ASIN/0596006349/dubinkoinfo-20">XQuery</a> by Priscilla Walmsley, XQuery <a href="http://en.wikibooks.org/wiki/XQuery">wikibook</a>.</p>
<p><a href="http://exist-db.org/">Download</a> and install. Needs a full JDK (Mac includes this already in /Library/Java/Home), a mere JRE is insufficient. Start up with bin/startup.sh.</p>
<p>eXist-specific useful functions: request:get-parameter() from the URI query string. transform:transform() function invokes XSLT from within XQuery.</p>
<p>Example uses doc() to fetch an external URL of RSS, check individual items with contains(). Every example is a fully-formed, click-on-a-link-to-run program.</p>
<p>XQuery and PHP: reallly basic integration with simplexml_load_file($myXQueryURL).</p>
<p>Loading scripts into eXist: He uses XML Spy. eXist has a Jaa Web Start admin client.</p>
<p>Q&amp;A: How bit is too big? Maybe 10-20-30 thousand docs. Generate indexes? Yes.</p>
<p>-m</p>
<p>(Production note: somehow, this one didn&#8217;t get published live. Now it is.)</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/12/11/xml-2008-liveblog-introduction-to-exist-and-xquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fun with xdmp:value()</title>
		<link>http://dubinko.info/blog/2008/11/28/fun-with-xdmpvalue/</link>
		<comments>http://dubinko.info/blog/2008/11/28/fun-with-xdmpvalue/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 05:47:47 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[languages]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[marklogic eval xquery higherorder context xpath sequenc]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=388</guid>
		<description><![CDATA[Lately I&#8217;ve been playing with some more advanced XQuery. One thing nearly every XQuery engine supports is some kind of eval() function. MarkLogic has several, but my favorite is xdmp:eval. It&#8217;s lightweight because it reuses the entire calling context, so for instance you can write let $v := 5 return xdmp:value("$v"). Not too useful, but [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been playing with some more advanced XQuery. One thing nearly every XQuery engine supports is some kind of <code>eval()</code> function. MarkLogic has several, but my <a href="http://developer.marklogic.com/pubs/4.0/apidocs/Extension.html#xdmp:value">favorite</a> is xdmp:eval. It&#8217;s lightweight because it reuses the entire calling context, so for instance you can write <code>let $v := 5 return xdmp:value("$v")</code>. Not too useful, but if the expression passed in comes from a variable, it gets interesting.</p>
<p>Now, quite a few standards based on XPath depend on the context node being set to some particular node. This turns out to be easy too, using the path operator: <code>$context/xdmp:value($expr)</code>. According to the definition of the XPath path operator, the expression to the right is evaluated with the results of the expression on the left setting the context node.</p>
<p>OK, how about setting the context size and position? More difficult, but one could use a sequence on the left-hand side of the path operator, with the desired <code>$context</code> node in somewhere in the middle. Then <code>last()</code> will return the length of the sequence, and <code>position()</code> will return, well, the position of <code>$context</code> in the sequence. But it&#8217;s kind of hacky to manufacture a bunch of temporary nodes, only to throw them away in the next step of the path.</p>
<p>I&#8217;m curious if anyone else has done something similar. Comments? -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/11/28/fun-with-xdmpvalue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XiX: Details about XForms in XQuery</title>
		<link>http://dubinko.info/blog/2008/11/04/xix-details-about-xforms-in-xquery/</link>
		<comments>http://dubinko.info/blog/2008/11/04/xix-details-about-xforms-in-xquery/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 07:05:20 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[XForms]]></category>
		<category><![CDATA[xpath]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[calculate]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[xix]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=380</guid>
		<description><![CDATA[I was asked offline for more details about what I have in mind around XiX. Take a simple piece of XML, like this: &#60;root&#62;&#60;a&#62;3&#60;/a&#62;&#60;b&#62;4&#60;/b&#62;&#60;total/&#62;&#60;/root&#62;. An XForms Model can be applied, in an out-of-line fashion, to that instance. This is done through a bind element, with XPath to identify the nodes in question, plus other &#8220;model [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked offline for more details about what I have in mind around XiX.</p>
<p>Take a simple piece of XML, like this: <code>&lt;root&gt;&lt;a&gt;3&lt;/a&gt;&lt;b&gt;4&lt;/b&gt;&lt;total/&gt;&lt;/root&gt;</code>.</p>
<p>An XForms Model can be applied, in an out-of-line fashion, to that instance. This is done through a <code>bind</code> element, with XPath to identify the nodes in question, plus other &#8220;model item properties&#8221; to annotate the instance. The <code>calculate</code> property is a good one: <code>&lt;bind nodeset="total" calculate="../a + ../b"/&gt;</code>. When called upon to refresh the instance, as you would expect, the result contains the node <code>&lt;total&gt;7&lt;/total&gt;</code>.</p>
<p>Like lots of algorithms, though, XForms is defined in a thoroughly procedural manner. Functional programming has a stricture against assignment operators, like setting the value &#8220;7&#8243; into the calculated node above. So the challenge is coming up with an implementation that works within these bounds. For example, perhaps a function that takes an original instance as input, and returns a newly-created updated instance. Simple enough for the example here, but in more complex cases with different and interacting model item properties, regenerating the entire instance frequently has performance penalties.</p>
<p>So, I&#8217;m trying to find the right expression of the XForms Model in a functional guise. (As <a href="http://rdfa.info/wiki/Functional_RDFa">with</a> RDFa). I&#8217;m curious about what anyone else has come up with in this area. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/11/04/xix-details-about-xforms-in-xquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XiX (XForms in XQuery)</title>
		<link>http://dubinko.info/blog/2008/10/30/xix-xforms-in-xquery/</link>
		<comments>http://dubinko.info/blog/2008/10/30/xix-xforms-in-xquery/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 22:07:32 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[intentional web]]></category>
		<category><![CDATA[patternalia]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[XForms]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[structures]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[xix]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=378</guid>
		<description><![CDATA[I&#8217;m pondering implementing the computational parts of the XForms Model in XQuery. Doing so in a largely functional environment poses some challenges, though. Has anybody tackled this before? How about in any functional language, including ML, Haskell, Scheme, XSLT, or careful Python? I borrowed the book Purely Functional Data Structures from a friend&#8211;this looks to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pondering implementing the computational parts of the XForms Model in XQuery. Doing so in a largely functional environment poses some challenges, though. Has anybody tackled this before? How about in any functional language, including ML, Haskell, Scheme, XSLT, or careful Python?</p>
<p>I borrowed the book <a href="http://www.amazon.com/exec/obidos/ASIN/0521663504/dubinkoinfo-20">Purely Functional Data Structures</a> from a friend&#8211;this looks to be a good start. What else is out there? Comment below. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/10/30/xix-xforms-in-xquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The case for native higher-order functions in XQuery</title>
		<link>http://dubinko.info/blog/2008/09/17/the-case-for-native-higher-order-functions-in-xquery/</link>
		<comments>http://dubinko.info/blog/2008/09/17/the-case-for-native-higher-order-functions-in-xquery/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 21:03:14 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[languages]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[higherorder]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[qsort]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=340</guid>
		<description><![CDATA[The XQuery Working Group is debating the need for higher-order functions in the language. I&#8217;m working on honing my description of why this is an important feature. Does this work? What would work better? Imagine you are writing a smallish widget app, in an environment without a standard library. When you need to sort your [...]]]></description>
			<content:encoded><![CDATA[<p>The XQuery Working Group is debating the need for higher-order functions in the language. I&#8217;m working on honing my description of why this is an important feature. Does this work? What would work better?</p>
<p>Imagine you are writing a smallish widget app, in an environment without a standard library. When you need to sort your widgets, you&#8217;d write a simple function with a signature like sort(sequence-of-widgets). That&#8217;s great.</p>
<p>Now imagine you find your app to be steadily growing. An accumulation of smaller one-off solutions won&#8217;t work anymore, you need a general solution. What you&#8217;ll end up with is something like <a href="http://www.cplusplus.com/reference/clibrary/cstdlib/qsort.html">qsort</a> in C, which takes a pointer to a comparator function. By providing different comparators, you can sort anything any way you like, all through only a single sort function. C and C++ have something like this, as do PHP, Python, Java, JavaScript, and even assembly language. XSLT has it, as proven by <a href="http://fxsl.sourceforge.net/">Dimitre</a>.</p>
<p>XQuery doesn&#8217;t. It should, because people are now using it for more than short queries. People are writing programs in it. -m</p>
<p>P. S. Comment please.</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/09/17/the-case-for-native-higher-order-functions-in-xquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Implementing RDFa in XQuery</title>
		<link>http://dubinko.info/blog/2008/08/04/implementing-rdfa-in-xquery/</link>
		<comments>http://dubinko.info/blog/2008/08/04/implementing-rdfa-in-xquery/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 06:09:46 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[rdfa]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=311</guid>
		<description><![CDATA[Through the weekend I put most of the final touches on an implementation of RDFa in XQuery. The implementation is based on the functional specification of RDFa, an offshoot of the excellent work coming out of the W3C task force. The spec contains a procedural description of the parsing algorithm, and several have successfully followed [...]]]></description>
			<content:encoded><![CDATA[<p>Through the weekend I put most of the final touches on an implementation of RDFa in XQuery. The implementation is based on the <a title="Functional RDFa" href="http://rdfa.info/wiki/Functional_RDFa">functional specification of RDFa</a>, an offshoot of the excellent work coming out of the W3C task force.</p>
<p>The spec contains a procedural description of the parsing algorithm, and several have successfully followed it to arrive at a conforming implementation. But you would have tough times explaining RDFa to someone that way. The functional description sort of fell out of the way I described RDFa to people.</p>
<p style="padding-left: 30px;">&#8220;When you see an element with XXXX, you generate a triple, using SSSS as the subject, PPPP as the predicate, and OOOO as the object.&#8221;</p>
<p>Which arguably is the more natural way to express the algorithm for functional languages like XQuery or XSLT. Fill in the right blanks and you pretty much have it. In practice, it&#8217;s somewhat more complicated, but not nearly so much as with other W3C specs.</p>
<p>I hope to make the code available soon. You&#8217;ll hear about it first here.</p>
<p>I&#8217;ll write more when I&#8217;m not exhausted. :-) -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/08/04/implementing-rdfa-in-xquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Complete this sequence&#8230;</title>
		<link>http://dubinko.info/blog/2008/07/25/307/</link>
		<comments>http://dubinko.info/blog/2008/07/25/307/#comments</comments>
		<pubDate>Sat, 26 Jul 2008 03:18:35 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[patternalia]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[structured]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=307</guid>
		<description><![CDATA[In C, if you find yourself writing large switch statements (or rafts of if statements), you should consider using pointers to functions instead. In C++, if you find yourself writing large switch statements (or rafts of if statements), you should consider using objects and polymorphism instead. In XQuery, If you find yourself writing large typeswitch [...]]]></description>
			<content:encoded><![CDATA[<p>In C, if you find yourself writing large switch statements (or rafts of if statements), you should consider using pointers to functions instead.</p>
<p>In C++, if you find yourself writing large switch statements (or rafts of if statements), you should consider using objects and polymorphism instead.</p>
<p>In XQuery, If you find yourself writing large typeswitch statements (or rafts of if statements), you should consider using _______________ instead.</p>
<p>Comment here. -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/07/25/307/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Starting to wrap my head around XQuery 1.1</title>
		<link>http://dubinko.info/blog/2008/07/16/starting-to-wrap-my-head-around-xquery-11/</link>
		<comments>http://dubinko.info/blog/2008/07/16/starting-to-wrap-my-head-around-xquery-11/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 06:38:34 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[announcement]]></category>
		<category><![CDATA[IPR]]></category>
		<category><![CDATA[Mark Logic]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[draft]]></category>
		<category><![CDATA[revision]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[xquery]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=303</guid>
		<description><![CDATA[Looks like a reasonably-sized revision. The first public working draft seems downright thin, in fact, relative to all the SHOULDs and MAYs in the requirements document. In particular, I&#8217;d like to see progress on 2.3.16 Higher order functions. (Then do we get a book XQuery: The Good Parts? &#8230;kidding..) -m]]></description>
			<content:encoded><![CDATA[<p>Looks like a reasonably-sized revision. The <a href="http://www.w3.org/TR/2008/WD-xquery-11-20080711/">first public working draft</a> seems downright thin, in fact, relative to all the SHOULDs and MAYs in the <a href="http://www.w3.org/TR/xquery-11-requirements/">requirements document</a>. In particular, I&#8217;d like to see progress on 2.3.16 Higher order functions. (Then do we get a book XQuery: The Good Parts? &#8230;kidding..)</p>
<p>-m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/07/16/starting-to-wrap-my-head-around-xquery-11/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XRX</title>
		<link>http://dubinko.info/blog/2008/05/29/xrx/</link>
		<comments>http://dubinko.info/blog/2008/05/29/xrx/#comments</comments>
		<pubDate>Thu, 29 May 2008 22:09:55 +0000</pubDate>
		<dc:creator>mdubinko</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[XForms]]></category>
		<category><![CDATA[XQuery]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[xquery]]></category>
		<category><![CDATA[xrx]]></category>

		<guid isPermaLink="false">http://dubinko.info/blog/?p=268</guid>
		<description><![CDATA[Bumped into XRX today. XForms + REST + XQuery. I like the sound of this, and XForms on the client just got a whole bunch easier&#8230; I&#8217;m seeing multiple signs that the confluence of XForms and XQuery has legs. (And REST just plain makes sense in any situation). -m]]></description>
			<content:encoded><![CDATA[<p>Bumped into <a title="simple, elegant, disruptive" href="http://www.oreillynet.com/xml/blog/2008/05/xrx_a_simple_elegant_disruptiv_1.html">XRX</a> today. XForms + REST + XQuery. I like the sound of this, and <a href="http://dubinko.info/blog/2008/05/22/xforms-ubiquity/">XForms on the client</a> just got a whole bunch easier&#8230;</p>
<p>I&#8217;m seeing multiple signs that the confluence of XForms and XQuery has legs. (And REST just plain makes sense in any situation). -m</p>
]]></content:encoded>
			<wfw:commentRss>http://dubinko.info/blog/2008/05/29/xrx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

