If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Wednesday, July 6, 2011

Unit testing XQJ and Saxon

I have to admit that it took me quite a bit of time to get this unit test working. All these namespaces don't make life easier. But let met explain what is going on in the code snippets below. First I wrote a little module which has 1 function that returns the groupId as a string. Luckily saxon did support the "at" hint for importing modules. But it took me quite some time to understand what the base-uri was used by saxon. Default it seems to be "" but it somehow knows how to resolve it to 'file:///c:/development/workspaces/cocoon3/cocoon-xmldb/'.

module containing 1 function that extracts groupId from pom

pom_module.xquery which imports pom.xqlib module and outputs groupId

No comments:

Post a Comment