[22 May 2013]
Register by the end of this week to get 10% off the normal registration price.
[19 February 2013]
Any project that uses XML intensively will occasionally find it handy to provide specialized interfaces for specific tasks. Historical documentary editions, for example, typically work through any document being published several times: once to transcribe it, several times to proofread it, once to identify points to be annotated, once (or more) to insert the annotation, once for indexing, and so on and so forth. Producers of language corpora similarly work in multiple passes: once to identify sentence boundaries in the transcriptions (possibly by automated means), once to check and correct the sentence boundaries, once to align the sentence boundaries with the sound data, and so on and so forth.
We can train all our users to use a general-purpose XML editor, but as Henry Thompson pointed out to me some time ago, one problem with that approach is that the person doing the correction of the sentence boundary markup probably should not be changing (on purpose or by accident) the transcription of the data. If you get bored by a tedious task while working with a general-purpose editor, there is essentially no limit to the damage you could do to the document (on purpose or by accident).
Each of these specialized tasks could benefit from having a specialized user interface. But how?
We can write an editor from scratch (if we have a good user interface library and sufficient time on our hands). Java and C++ and Objective-C all have well known user-interface toolkits; for many other languages, the user-interface toolkits are probably less well known (and possibly less mature) but they are surely there. Henry Thompson and his colleagues in Edinburgh did a lot of work in this vein using Python to implement what they called padded-cell editors.
We don’t have to write the editor from scratch: we can adapt a general-purpose open-source editor (if it’s in a language we are comfortable working in).
We can customize a general-purpose editor (if it has a good customization interface and we know how to use it). I believe a lot of organizations have commissioned customized versions of SGML and XML editors over the years; at one point, SoftQuad had a commercial product (Sculptor) whose purpose was to allow the extension and customization of Author/Editor using Scheme as the customization language.
We can write elaborate user interfaces with XSLT 2.0 in the browser, using Michael Kay’s Saxon-CE.
We can write XForms, which have the advantage of being strictly declarative and (for many developers) of allowing much of the work to be done using familiar XHTML, CSS, and XPath idioms.
How well do these different approaches work? What is the experience of people and projects who have used them? And how is a person to choose rationally among these many possibilities? What are the relative strengths and weaknesses of the various options? What are the prospects for future developments in this area? These are among the questions I expect attendees at the symposium will get a better grip on.
(As any reader of this blog knows, I think XForms has a compelling story to tell for anyone interested in user interfaces to XML data, so I expect XForms to be prominent in the symposium program. But I’m interested in any and all possible solutions to the problem of developing good user interfaces for XML processing, so we are casting our nets as widely as we can in defining the topic of the symposium.)
I hope to see you there!
[9 July 2012]
A couple of weeks ago, I took some time to explore the use of sub-forms in XSLTForms, as a possible way to speed up an XForm I had written that was a little slower than I would have liked.
The short version of the story is: WOW! Well worth learning to use.
To understand the longer version, dear Reader, you should know that one of the most common performance issues in serious uses of XForms is that forms sometimes slow down when the instance documents they are working on get big. I assume this is because browsers are profligate with resources, perhaps because some aspects of the XML DOM force them to be, perhaps because profligacy pays off most of the time. But I can’t say I really know for sure.
So one of the things that sophisticated users of XForms spend a lot of time on is finding ways to avoid loading all the instance documents at once. (This is a lot easier when you’re using an XML database as a back end, of course.) Another is finding ways to avoid loading all of the form at once; that is where sub-forms come in. The word doesn’t occur in the XForms 1.1 spec, but a number of implementations provide experimental support for sub-forms as an extension. The basic idea is that whenever certain events occur in a form, the XForms implementation will load some appropriate resource specifying some XForms widgets and bind them into the current form. When other events occur, those widgets will be unloaded again. I first saw this in a demo on the BetterFORM site a few years ago, but I see that Mark Birbeck was talking about this as long ago as 2006. And more recently, Alain Couthures has added sub-form support to XSLTForms.
Making my form use a sub-form turned out to be simpler than I had feared. I already had a full working version of the form, and it was clear which part of it I wanted to load and unload dynamically. What I had to do was just:
xf:groupwhere the sub-form used to be; give that group an ID.
loadaction with the appropriate event. (In my form, I had a trigger that toggled a switch, exposing the read/write view of some material. The sub-form now has that read-write view, and the trigger now throws a
unloadaction with another appropriate event. (In my form, this was the trigger that formerly toggled the switch back to the read-only view.)
In principle, that’s it, though I had to fiddle a bit to make everything work right. In particular I ended up adding a
ref="." attribute to the outermost
xf:group in the sub-form. I’m not yet sure just when this is necessary and when it’s not.
The simple example of sub-forms loading on the XSLTForms web site is very helpful here: it’s a very simple example and illustrates all the moving parts clearly. (But you will need to read the source and think about what is going on; there isn’t a lot of commentary or documentation around.)
What really impressed me were the effects of this change on the performance of the form.
Since sub-form support was added fairly recently to XSLTForms, I had to upgrade from an older release of XSLTForms to the recent release 1.0RC. I did some fairly tedious timings before and after I made the change, and I can say with some evidence that this change alone gave my form about a 25% increase in speed. Then I made the changes mentioned above, to use sub-forms. That gave me another 25% increase, so that on almost all actions version 1.0RC using sub-forms was about twice as fast as the older version Beta3 using a monolithic form.
Moral 1: If you are having performance issues with an XForm, and you can see how you might use a sub-form, then try it.
Moral 2: If you are having performance issues with an XForm, and you are using XSLTForms, then try moving to 1.0RC even if you can’t see how to use a sub-form in your context. Alain Couthures has done a lot of work on performance, and it clearly helps.
Bear in mind that the precise syntax and semantics of sub-forms are a topic of discussion in the XForms working group, so (a) they are subject to change, and (b) the working group is open to suggestions for making sub-forms (or any other part of XForms) work better.
[5 April 2012]
I’ll be teaching three courses / workshops this June.
Recently the organizers of the ACM / IEEE-CS 2012 Joint Conference on Digital Libraries asked me to teach a pre-conference tutorial on “Making the most of XML in Digital Libraries”; JCDL will be hosted by George Washington University in Washington, DC, this year.
The tutorial description runs something like this:
The Extensible Markup Language (XML) was designed to help make electronic information device- and application-independent and thus give that information a longer useful lifetime. XML is thus a natural tool for constructing digital libraries. But where exactly does XML fit into the conceptual framework of digital libraries? Where can XML and related technologies help achieve DL goals?
This tutorial will provide participants with an introduction to basic concepts of XML and a DL-oriented overview of XML and related technologies (XML, XPath, XSLT, XQuery, the XML information set, XDM, XForms, XProc, and many more). The intent is to show how XML can be used to help digital libraries achieve their goals and to enable participants to know which XML technologies are most relevant for the work they are involved with.
The JCDL site doesn’t have a detailed schedule yet, so I don’t know the exact time and date of this tutorial.
I’ve also arranged with Mulberry Technologies of Rockville, Maryland, to use their training facilities to offer two two-day training courses immediately before and after the JCDL conference, so that people traveling to DC for JCDL can extend their trip at one or both ends to attend the courses.
The XForms course will be held just before JCDL, on Friday and Saturday 8 and 9 June.
The other course provides an introduction to XQuery for documents. Much of the interest in XQuery has come from database vendors and database users, and not surprisingly much of the public discussion of XQuery has focused on the kinds of problems familiar to users of database management systems. Those who use XML for natural-language documents have, I think, sometimes gotten the impression that XQuery must be aimed primarily at other kinds of XML and other kinds of people. This course is designed to introduce XQuery in a way that underscores its relevance to the human-readable documents that are historically the core use case for XML, with examples that assume an interest in documents rather than an interest in database management systems. This course will be held just following JCDL, on Friday and Saturday 16 and 16 June.
Further information on the two Black Mesa Technologies courses is on the Black Mesa Technologies site at the pages indicated.
[20 February 2012]
This is another in an ongoing series of posts describing the design and implementation of the evaluation forms we put together last year for Balisage: The Markup Conference. The first post in the series discussed the overall look and feel of the forms.
The conference has used printed feedback forms in the past, and the online forms ask essentially the same questions as the paper forms have always asked. Overall, what’s your impression of the registration process? the materials (the on-site guide to the conference, the proceedings), etc. etc. For each question, the paper forms ask for an overall judgement (Good, Okay, Bad) and provide a space for comments. In recent years, the space for the overall judgement has taken the form of three small graphic images, showing smiling, neutral, and frowning faces:
The XML document created by the form has a sequence of elements for the various topics:
presentations, etc. Each covers one question in the form. For most questions, the element has an attribute named
overall to record the user’s overall judgement of how well we did in that area, and its contents include any comments the user types into the comments field. (A few questions have a more complex XML representation, which will be discussed in separate posts.) If you would like to see the XML produced by the form in full detail, you can: go to the overview page, select the form you want to examine, optionally fill it in with some sample data, and select the Show XML button at the bottom of the page.
A straightforward translation into XForms of the question about registration would use a
select1 element with the three values Good, Okay, and Bad, and an associated comments field, like this:
<xf:group ref="instance('eval')/registration"> <xf:label>Registration process</xf:label> <xf:select1 ref="@overall" appearance="full"> <xf:label/> <xf:item> <xf:label>Good</xf:label> <xf:value>good</xf:value> </xf:item> <xf:item> <xf:label>Okay</xf:label> <xf:value>okay</xf:value> </xf:item> <xf:item> <xf:label>Bad</xf:label> <xf:value>bad</xf:value> </xf:item> </xf:select1> <xf:textarea ref="."> <xf:label>Comments</xf:label> </xf:textarea> </xf:group>
In a browser, it would look something like this:
You can also load the entire form into your own browser to examine it.
The first obvious enhancement is to follow the paper form in using images of smiling and frowning faces for the various values. A few hours on the Web turned up a large number of public-domain clip-art sites, many with sets of widgets including smiling and frowning faces. It turns out that there are also smiling-face and frowning-face characters in Unicode (in the Miscellaneous Symbols block U+2600 to U+26FF), but no corresponding neutral face. And nowadays there is an entire block of Unicode emoticons (U+1F600 to U+1F64F). I was tempted by the Unicode characters, but ultimately decided that on my screen, at least, they were too hard to read clearly. So eventually I settled on a set of icons from a clip-art site.
Integrating the smiley images into the labels is simple: just embed an
img element in the label, as shown here.
<xf:group ref="instance('eval')/registration"> <xf:label>Registration process</xf:label> <xf:select1 ref="@overall" appearance="full"> <xf:label/> <xf:item> <xf:label> <img src="lib/smiley_thumbs_up.png" class="emoticon" height="20" alt="Good"/> Good </xf:label> <xf:value>good</xf:value> </xf:item> <xf:item> <xf:label> <img src="lib/smiley_pleased.png" class="emoticon" height="20" alt="OK"/> Okay </xf:label> <xf:value>okay</xf:value> </xf:item> <xf:item> <xf:label> <img src="lib/smiley_thumbs_down.png" class="emoticon" height="20" alt="Bad"/> Bad </xf:label> <xf:value>bad</xf:value> </xf:item> </xf:select1> <xf:textarea ref="."> <xf:label>Comments</xf:label> </xf:textarea> </xf:group>
This provides a bit more color in the form:
To make it easier to see what the images are saying, the full form includes a large version of the images at the top, with explanatory labels. (This version of the form actually uses two different sets of clip-art images, so I could look at each of them in context and decide which one I wanted to use.)
The overall Good / Okay / Bad ratings still take up a lot of screen real estate, though.
And what I really wanted was not just to use the images as part of the labels for the radio buttons, but to have an even simpler interface: ideally, I wanted just to show the three icons and let the user click on them to specify that they thought things were good, back, or okay. (There is a certain amount of danger in this way of thinking: part of the point of XForms is to provide device-independent forms that might be rendered in different ways on different devices: getting really specific about details like this may interfere with device independence.)
This can be achieved in XForms, too. After some experimentation, I ended up a method of handling this that looks like this in the browser: a large image showing the current rating for the topic, and three small images (but larger than the images in the earlier versions of the form) for changing the rating.
The large display is handled with a sequence of
xf:group elements, each of which contains an
img element and each of which binds to the overall rating for a given topic if that rating has the particular value associated with the image.
<xf:group ref="instance('eval')/registration"> <xf:label>Registration process</xf:label> <div class="overall-rating"> <xf:group ref=".[@overall='good']"> <img src="lib/smiley_thumbs_up.png" height="150px" alt="good"/> </xf:group> <xf:group ref=".[@overall='okay']"> <img src="lib/smiley_pleased.png" height="150px" alt="okay"/> </xf:group> <xf:group ref=".[@overall='bad']"> <img src="lib/smiley_thumbs_down.png" height="150px" alt="bad"/> </xf:group> <xf:group ref=".[@overall='dunno']"> <img src="lib/smiley_no_speak.png" height="150px" alt="good"/> </xf:group> </div> ... </xf:group>
So the big image for the registration topic will show a smiling face if the
overall attribute on the
registration element has the value
good, and a frowning face if it has the value
bad, and so on.
The value of the
overall attribute could be set by the
select1 elements shown above, but in the final version we used a set of XForms triggers (user-activatable controls — on a laptop screen these are typically buttons) labeled with the images for the values:
<div class="simple"> <xf:group ref="instance('eval')/registration"> <xf:label>Registration process</xf:label> ... <!--* read-only display image, as shown above *--> <div class="overall-triggers"> <xf:trigger> <xf:label><img src="lib/smiley_thumbs_up.png" height="40" alt="good"/></xf:label> <xf:setvalue ev:event="DOMActivate" ref="@overall" value="'good'"/> </xf:trigger> <xf:trigger> <xf:label><img src="lib/smiley_pleased.png" height="40" alt="okay"/></xf:label> <xf:setvalue ev:event="DOMActivate" ref="@overall" value="'okay'"/> </xf:trigger> <xf:trigger> <xf:label><img src="lib/smiley_thumbs_down.png" height="40" alt="bad"/></xf:label> <xf:setvalue ev:event="DOMActivate" ref="@overall" value="'bad'"/> </xf:trigger> </div> <xf:textarea ref="."> <xf:label>Comments</xf:label> </xf:textarea> </xf:group> </div>
As you can see, each trigger contains a
label element which in turn contains the image, and a
setvalue element which specifies the action to be run when the trigger is activated. In each case, the action is to set the value of the
overall attribute to the appropriate value.
The group as a whole, the large image, and the set of three triggers are each wrapped in an XHTML
div element with a different
class value, to make it easier to style the display appropriately using CSS.
[16 January 2012]
In a previous post, I mentioned the evaluation forms we put together for the Balisage conference last year, using XForms. This is the first of a series of posts discussing some aspects of the design and development in more detail.
One of the first requirements for these forms was that if at all possible they should have the same look and feel as the pages on the main conference site. In XForms, this turns out to be remarkably simple: XForms is designed to be styled using whatever styling mechanisms are usual for the host document vocabulary. In the case of XForms in XHTML, running in a Web browser, that means the form can be styled using CSS. And because the form is embedded in a normal XHTML document, any necessary logos or graphic apparatus can be embedded in the normal way.
The forms pointed to http://balisage.blackmesatech.com/ do three things to maintain the Balisage look and feel:
They point to an appropriate CSS stylesheet, in the usual way.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xhtml:dummy="Help the poor user of Mozilla evade the Mozilla namespace curse" ... > <head> <title>Balisage Speaker/Presentation Feedback</title> ... <link href="lib/feedback.css" rel="stylesheet" /> ...
xhtml:dummy attribute is a work-around that helps XSLTForms compensate for the bug in Mozilla’s XSLT implementation: Mozilla does not support the XPath
namespace axis, so the only way XSLTForms can discover what namespaces are in scope is to walk around the tree collecting namespace bindings from elements and attributes in the document. The value of the attribute doesn’t matter; I use a value that reminds me of why I have to have the attribute there in the first place.]
They use the same overall document structure as the main Balisage pages: three divs of class
with the second in turn divided into
<body> <div class="header"> ... </div> <div class="mainbody"> <div class="navbar"> ... </div> <div class="body"> ... </div> </div> <div class="footer"> <hr /> <p>Last revised 26 July 2011. Copyright © 2011 <a href="http://www.blackmesatech.com/">Black Mesa Technologies LLC</a>. <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"> <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a> <br/> The <span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/InteractiveResource" property="dct:title" rel="dct:type">Balisage 2011 Feedback Forms</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="http://balisage.blackmesatech.com/2011/feedback/" property="cc:attributionName" rel="cc:attributionURL">Black Mesa Technologies LLC</a> are licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/" >Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p> </div> </body>
[Note: strictly speaking, as those who go and look at the HTML coding of the main Balisage site will discover, this is not “the same overall document structure” as the main Balisage pages. For reasons I won’t go into here, the main Balisage site uses XHTML tables to lay out the pages. I usually try to avoid tables, so the forms use
div elements with CSS style rules to govern the layout. Apart from avoiding invidious comments from those who disapprove of using tables for layout purposes, I find the documents somewhat easier to navigate and edit this way.]
They embed the appropriate material. The header embeds the Balisage logo:
<div class="header"> <a href="http://www.balisage.net/"> <img src="bflib/Balisage-2011-logoType.png" width="35%" alt="Balisage 2011 logo"/> </a> </div>
And the navbar embeds a suitable set of links.
<div class="navbar"> <p class="upbutton"> <a href="http://www.balisage.net/">Balisage 2011</a> </p> <p class="upbutton"> <a href="../../">Balisage at Black Mesa Technologies</a> </p> <p class="downbutton"> <a href="http://www.balisage.net/2011/Program.html">Program</a> </p> <p class="downbutton"> <a href="index.xml">Balisage 2011 Feedback Forms</a> </p> <p class="downbutton"> <a href="conference.xhtml">Conference Feedback</a> </p> <p class="downbutton"> <a href="symposium.xhtml">Symposium Feedback</a> </p> <p class="downbutton"> <a href="speaker.xhtml">Speaker Feedback</a> </p> </div>
It turns out to be psychologically helpful to have the form appropriately styled, both for me in developing it and for those whom I ask to review draft versions of the form. It’s so helpful, in fact, that one of the first things I do, in developing a form for a particular site, is to create an XForms template for the site, with
XForms is designed to allow forms to be integrated nicely into a site’s normal look and feel; the template makes it easier to do that consistently across all the forms used on a given site.
[9 January 2012]
In recent years I’ve spent a fair amount of time telling people about XForms as a method for making special-purpose XML editors. From time to time people ask me what sorts of things it’s possible to do in XForms, and by implication what sorts of things don’t fit very well in XForms. It’s a good question, but I don’t know a good way to answer in words. The only way I know to answer is to show some examples of things done in XForms.
In that connection, perhaps it’s worth while to point to an XForms application I put together last year for Balisage 2011. The organizers of Balisage place great weight on feedback from participants, and we’ve always used paper feedback forms distributed to participants on the last day of the conference. Paper forms have the drawback of only being in one place at any given time, and since the organizers don’t all work in the same location, most of the organizers only got a chance to look at the feedback forms on the afternoon after the conference ended, before everyone went home. (Yes, we could have had them photocopied, but we never got around to it.) So last year I suggested we do electronic forms, in addition to the paper forms (which we entered into the electronic system by hand, afterwards).
These feedback forms posed a few interesting design challenges, and I went through several iterations, bugging my colleagues on the organizing committee for feedback until I suspect most of them were heartily sick of the whole thing. The various alternatives are worth some discussion; in subsequent posts I’ll discuss the issues and some of the alternative ways of handling them in XForms.
[30 March 2011]
I’m happy to announce that in June, I’ll be offering a two-day hands-on XForms course in San Carlos, California, in facilities generously provided by MarkLogic Corporation (itself a user of XForms technology).
The organization of the material will be substantially the same as in the earlier iterations of the course. And the rationale for XForms, as I understand it, remains as described in an earlier post to this blog; the course is directed to users of XML who want to use XForms to work with XML representations of information.
In case it matters to potential attendees, I’ll point out that the course will occur just before the Digital Humanities 2011 conference down the road in Palo Alto.
[5 January 2011; typo corrected 24 Jan 2011]
Black Mesa Technologies has scheduled a two-day hands-on class on the basics of XForms, to be taught 14-15 February 2011 in Rockville, Maryland, in the training facility of Mulberry Technologies (to whom thanks for the hospitality).
The course will cover the XForms processing model, the treatment of simple values and the creation of simple structures, repetitions of the same element, sequences of heterogeneous elements, and techniques for using XForms for complex forms, dynamic interfaces, and multilingual interfaces. It’s based on the one-and-a-half day course given last November at the TEI Members Meeting in Zadar, Croatia, which (judging by the participants’ evaluations) was a success.
XForms have great potential for individuals, projects, and organizations using XML seriously: XForms is based on the model / view / controller idiom, and the model in question is represented by a set of XML documents. That means that you can use XForms to create specialized editing interfaces for XML documents, which exploit the styling and interface capabilities of the host language (typically XHTML) and can also exploit your knowledge of your own data and requirements.
Some people have built more or less general-purpose XML editors for specific vocabularies using XForms. That works, I think, more or less, though in many cases I think you’ll get better results acquiring a good XML editor and learning to use it. XForms really shines, I think, in the creation of ad hoc special-purpose editors for the performance of specialized tasks.
In many projects, XML documents are created and refined in multiple specialized passes. In a historical documentary edition, the document will be transcribed, then proofread and corrected in multiple passes performed by different people, or pairs of people. Another pass over the document will mark places where annotations are needed and note the information needed to write those annotations. (“Who is this person mentioned here? Need a short biographical note.”) And so on.
In a language corpus, an automated process may have attempted to mark sentence boundaries, and a human reviewer may be assigned to correct them; the only things that reviewer is supposed to do are open the document, split all of the
s elements where the software missed a sentence boundary, join adjacent
s elements wherever the software was wrong in thinking it had found a sentence boundary, save the document, and quit. If you undertake this task in a full XML editor, and you get bored and lose concentration, there is essentially no limit to the amount of damage you could accidentally do to the data by mistake. What is needed for situations like this is what Henry Thompson of the University of Edinburgh calls ‘padded-cell editors’ — editors in which you cannot do all that much damage, precisely because they are not full-featured general-purpose editors. Because they allow the user to do only a few things, padded-cell editors can have simpler user interfaces and be easier to learn than general-purpose editors.
The construction of padded-cell editors has always been a complicated and expensive task; it’s going to take thousands, or tens of thousands, of lines of Java or Objective C or Python to build one, even if you have a reasonably good library to use. With XForms, the high-level abstractions and the declarative nature of the specification make it possible to do roughly the same work with much less code: a few hundred lines of XHTML, CSS, and XForms-specific markup.
This is why I think XForms has a place in the toolkit of any project or organization making serious use of XML. And, coincidentally, it may be a reason you, dear reader, or someone you know may want to attend this XForms course.
(Oh, yes, one more thing: we have set up an email announcement list for people who want to receive email notification of this and other courses organized or taught by Black Mesa Technologies; a sign-up page is available.)