Passing parameters to an XQuery or XSLT through an XProc Pipeline

I’ve recently been helping someone get started with the XML REST Framework, and they asked about getting query string parameters into the XQueries or XSLTs that were a part of their resource implementation. For those of you who are not familiar, what the XML REST Framework does is leverages Spring MVC for all of the HTTP protocol stuff, a developer builds a very thin Java shim to an XProc pipeline that implements the RESTful service. The post I link to above and two earlier versions explain this all in more detail. What I am focusing on in this post is how I can get values from the query string into the right places within my pipeline; there are two parts to this. 1) you need to get your hands on the query string argument and 2) you need to pass that into the XProc pipeline in such a way that it gets to the XQuery or XSLT. It turns out that #2 was already demonstrated in the class file in combination with the resourceGET.xpl. Let’s drill in on that a little bit.

Balisage 2011

I made it to the Balisage conference this year. I’d been eyeing the conference for a couple of years, so I submitted a paper proposal that was accepted and spent the first week of August in Montreal. I confess, aside from a couple of morning runs in the Mount Royal Park, (which is just fantastic) […]

XSLT and the default namespace

A colleague of mine who is relatively new to XSLT was getting bitten by an issue with a “hello world” stylesheet where the elements in the source document were all in a namespace and he wasn’t addressing or even including the namespace in the declarations of the XSLT. I found a great write-up that describes […]

The JSON and XML debate and what worries me most about JSON…

…my concern is not one of features of JSON – please read on.Okay, so I’ve spent a fair part of the afternoon today surfing through dozens of articles that address JSON vs. XML. And like any other “vs.” debate, these articles express capabilities of each and there are obviously “things” that one addresses differently than […]

XML Spy bug: predicate evaluation order

The Xpath 2.0 specification describes predicates and specifically predicate ordering with “In the case of multiple adjacent predicates, the predicates are applied from left to right, and the result of applying each predicate serves as the input sequence for the following predicate.” Unfortunately XML Spy seems to have a bug. Given the following example, again […]