Tag xquery

Models in XQuery

At MarkLogic, I work on a team that is charged with building Proof-of-Concept systems quickly and building them well enough that the developers who take over later will have a good starting point. I’d like to talk more about the…

Meaningful XML

Another day, another code review. Today I came across a function that generates non-meaningful XML. This is something that at first glance feels like it has a nice structure to it, but there’s a better way. First, let take a…

Exceptional code

Today I was looking into some code that was running slower than it should, and I happened across this little tidbit: let $normal :=   try {     xs:int($value)   }   catch($e) {     $value   }…

TDD with XQuery

Today I had a complicated function to write. The framework we’re using for this project has unit testing built into it, so for the first time in a long time, I did the Test Driven Development approach: I wrote a…

Unparsing a custom facet

In many search applications, when we show the results of a user’s search, we also want to display the search that was done by putting the query string into a text box, especially if the search is built up from…