The big question here is whether this technology can be brought to a level at which non-programmers can learn it in a reasonable time. A "reasonable time" is more than five minutes, but it's almost closer to learning how to ride a bicycle than how to play the violin.
I believe so. In the process of arguing in favor of XML databases for
use in client-side HTML storage*, I've also proposed allowing a
jQuery-like syntax against client-side databases, jQuery being a hugely
popular and easy-to-learn JavaScript library, since CSS Selectors
(which jQuery uses) should, I believe, be fully convertible into XPath
(as John Resig has done in the other direction for simple XPath), which
is a subset of the yet more powerful XQuery. Even if such an interface
is dumbing things down compared to XQuery or even XPath, it may be more
comfortable to get people used to it (and jQuery has its own
XQuery-like functions for easily iterating nodes, etc. anyways).
Client-side usage might look like this (where the client-side database
"Classics" had been created earlier by some other web API function
call):
pre.navy_sh_sourceCode {
background-color: #000035;
color: lightblue;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_keyword {
color: darkorange;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_type {
color: #e1e72f;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_string {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_regexp {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_specialchar {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_comment {
color: #ffbb00;
font-weight: normal;
font-style: italic;
}
pre.navy_sh_sourceCode .navy_sh_number {
color: #f87ff4;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_preproc {
color: #bb00ff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_symbol {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_function {
color: yellow;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_cbracket {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_url {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_date {
color: #f8c50b;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_time {
color: #f8c50b;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_file {
color: #f8c50b;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_ip {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_name {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_variable {
color: #13d8ef;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_oldfile {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_newfile {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_difflines {
color: #f8c50b;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_selector {
color: #13d8ef;
font-weight: normal;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_property {
color: #f8c50b;
font-weight: bold;
font-style: normal;
}
pre.navy_sh_sourceCode .navy_sh_value {
color: #ffffff;
font-weight: normal;
font-style: normal;
}
$('db("Classics", "Classic Literature Database") '+
'collection("ShakespeareWorks") .irony'.each(function (ironicPassage) {
$('#TheBardBeingIronic').append(ironicPassage);
});
The above finds every ironic passage of Shakespeare in the
locally-stored collection and adds the passages to an HTML element.
Even querying remote XML/HTML stores should be possible for client-side
HTML too (as it already available to server-side languages), especially
if websites were not forced to obtain explicit permissions from the
remote site but could instead make cross-domain requests (via HTML
Ajax), conditional on user permission:
https://bugzilla.mozilla.org/show_bug.cgi?id=573886 . This would allow
any website to be treated as a data store (including TEI ones) with the
burden shifted away from the server to the user who could query to
their heart's content without slowing down an intermediate server (but
still allowing that third-party the ability to make a user interface
available to them in HTML). But because there are security issues when
incorporating content from remote sites, it would need to require
permission by the user.
For example, the remote querying might look as simple as this:
As above, this finds every ironic passage of Shakespeare in the
specified works and adds the passages to an HTML element, but in this
case, the files have not been created locally, but are available live
from remote. (The best of both worlds could be possible if the
client-side storage could be made to check periodically for updates.)
If you XML fans want to see this kind of functionality available to
browsers (which could either use jQuery or ideally XQuery itself), so
that any web designer could make an interface which would work against
your TEI, whether stored on a remote server, or designed to be
installable via the web into a web-accessible client-side database,
voice your support in the HTML5 WHATWG email list
(
http://www.whatwg.org/mailing-list )!
Brett
* In the discussion thread about IndexedDB, the proposed standard for
allowing client-side database storage inside HTML5 at
http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/comment-page-1/#comment-96635