XQuery, learning by example

But where are the XBRL use-cases? Nowhere in particular

If you set out to explore XQuery, the XML query language, you'll soon encounter a collection of examples, or use-cases, that show how XQuery can query and transform XML data. These scenarios are elaborated in a W3C document that presents a sample data set -- about books, authors, prices, and reviews -- and enumerates a set of queries against that data. For each query, there's a description ("List names of users who have placed multiple bids of at least $100 each"), a solution written in XQuery code, and an expected XML output.

XQuery vendors love to demonstrate that their software can run these standard tests and produce correct results. Such demonstrations help validate implementations and serve as tutorials for learning the language.

The use-cases weren't just slapped onto XQuery after the fact. They actually came first, and they guided the long and difficult process of developing XQuery. Jonathan Robie was one of the prime movers in the development of XQuery. When I interviewed him last year, he said that the use-cases provided invaluable guidance, and that he'd never attempt a project of similar scope without such guidance.

Now let's contrast XQuery with another XML-based standard of comparable heft, XBRL (Extensible Business Reporting Language). Even if you're not an accountant, you may know that XBRL is building momentum. There's growing recognition that financial reporting based on a mishmash of Word, Excel, PDF, and HTML files won't suffice. We require more speed and better transparency, and the consensus is that XBRL can and must meet those needs.

Last year the FDIC required banks to submit call reports in XBRL format. In September, the SEC awarded US$54 million in contracts to convert its legacy EDGAR system to XBRL, and to complete the taxonomies that will enable all U.S. companies to file their required disclosures in XBRL.

But where are the XBRL use-cases? Nowhere in particular. You can find scattered examples on Web sites run by XBRL International, the International Accounting Standards Board, or XBRL vendors. But there's nothing like XQuery's canonical set. As a result, a vast chasm stretches between accountants, who know about corporate earnings reports and SEC filings, and XML technologists, who know about XML Schema and XLink.

Charlie Hoffman, an accountant who saw the need for XBRL in 1998 and who has been the prime mover in its development ever since, is hard at work trying to bridge that chasm. In the podcast mentioned in my last column on XBRL, I noted that one of XBRL's claimed virtues -- modular extensibility -- wasn't clearly illustrated in any existing documentation. Hoffman took that as an action item and recently showed me a draft document that's rich with examples. But why only now? And why Charlie Hoffman, rather than the XML experts who have worked on XBRL?

The answer is that XQuery's history is an exception. Software technologists, as a rule, undervalue examples. The Unix man page is a classic illustration of this mind-set. It's a dictionary of raw capabilities. Applying them is left as an exercise for the reader.

Would up-front use-cases have made XBRL simpler and better? We'll never know; that's water under the bridge. If the XBRL examples arrive late, that's better than never. But here's hoping that future projects will heed Jonathan Robie's advice and write the use-cases first.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Jon Udell

Show Comments

Father’s Day Gift Guide

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?