Bear Patrol
Monday, November 26th, 2007

Now the more credulous amongst you are probably thinking “My god, bears are attacking Matthew’s screen!” but before you rush in to save me I’d like to explain these images. These two screenshots demonstrate the same menu being displayed as XHTML and then as XUL (respectively). The XHTML version comprises of XHTML+JavaScript whereas the XUL version creates native toolbar widgets across the top of the page. This is produced with an XML Pipeline Processor based around XML, filter plugins, and XSLT. These XML Pipelines (a.k.a. XML chains) are comparable to specialised Unix Pipes:
“A set of processes chained by their standard streams, so that the output of each process feeds directly as input of the next one. Filter programs are often used in this configuration. The concept was invented by Douglas McIlroy for Unix shells and it was named by analogy to a physical pipeline.”
- Wikipedia
Source data is generated (typically by reading a file) and this is passed through a series of conversion stages (XSLT or STX) and the end result is whatever remains. Much like Unix Pipes themselves much of the value of XML Pipelines comes from having discrete components that are easily composed into more complex conversion chains.

(thanks to Apache Cocoon for the image)
XML Pipelines are a popular approach to multi-format publishing and they’re a natural fit to the problem of HTML abstraction as discussed in the previous blog post.
Introducing, PilferPage…
PilferPage will be a series of XML Pipelines and XSLT/STX stylesheets that convert an abstract page definition into HTML4, HTML5, RSS, Atom, XSL-FO, XUL, XAML, Flash/Flex, JSON (for serializing data), and so on.
There are a couple of benefits to the XML Pipeline approach,
- Any modern language can benefit from them (the abstraction doesn’t favour Python, Ruby, PHP, C#…);
- This would also allow any existing framework to change their output to be PilferPage, and then benefit from the abstraction;
- XML is a natural fit for GUIs, as shown by modern GUI languages such as HTML5, XAML, XUL, Glade(GTK). Semi-structured data suits markup, and markup makes the relationship between components more clearly expressed through node hierarchy.
- Many developers already know XSLT.
So, in the coming weeks I’ll start opening up for debate the design of PilferPage. We’ll try to talk about commonalities between all the formats and see about writing XSLT that will convert PilferPage to these formats.
“Change happens and nothing prepares you better than having your gooey in XML than tied to one vendor’s GUI API in a single language be it Java, C# or whatever else comes along. If the DTD/schema changes you can use XSLT to automatically convert old XUL files to new ones.”
- LUXOR Interview
XML GUIs marginalize the “single language” in the same way that databases marginalize the languages reading from them by abstracting data. This PilferPage abstraction does mean coding to an open standard (it will be open source) but with XSLT that allows developers to leave – to any of the output formats – they shouldn’t feel captive or as if they’re coding in a proprietary environment.
In the next post, we’ll talk about commonalities in page layout (3 columns + header/footer or something more flexible?).
Update (2nd December): Why the name PilferPage? It’s a tedious story, so skip ahead to the next paragraph for the short version. In 2002 I started some weblog software called PHPilfer which was named after some misinformative speeches by Microsoft’s Steve Balmer about how open source was intellectual property theft (he was referring to the propagating nature of the GPL). The name PHPilfer was about ridiculing the notion that any license could cause infringement of intellectual property, or that Open Source was any more “infectious” than proprietary software (try selling a modified Microsoft Office and see whether the copyright holder asserts their license rights to restrict your modifications, for example). PHPilfer was easy to administer, entirely themeable, had pretty URLs, and MetaFilter took some ideas from it. Ultimately though it was mediocre software and I stopped writing PHPilfer in 2004, which was a pity because I liked the name.
PilferPage is about straddling a useful subset of many UI languages and building upon their shared commonalities. It should be about taking the best ideas and reusing common knowledge about good UI XML design. So, again, the name PilferPage is a joke about IP only this time it’s about pointing out the overlap between UI languages, how they’re stealing from each other, and how we’re going to do that too.

or a date picker could be native in HTML 5 but emulated in HTML 4. A programmer putting slider controls on a page shouldn’t code to a particular output format, they shouldn’t have to care.