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…
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…
In XQuery, you can build an element one of two ways: computed or direct. Direct This is the simpler case, so I’ll take it first. Direct means that your XQuery code has the XML you want to build: declare namespace…
A while ago I was posed a question by a colleague: (1,3,2)[.] -> 1 (1,2,3)[.] -> 1 2 3 (2,3,4)[.] -> no result why? To find the answer, we need to think about what’s happening in the brackets. As discussed…
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…
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  }…
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…
While looking at the database configuration in MarkLogic Server, have you ever noticed the Word Query link on the left? (Click Configure -> Databases -> the name of one of your databases -> Word Query.) Ever wonder what it does?…
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…
I recently got to teach the MarkLogic Essentials class for MarkLogic University. To illustrate custom facets, I implemented one on the fly with the class watching. No pressure. :) The good news is that it (almost) worked with the first…
I’m going to be teaching the MarkLogic University Basic XQuery class tomorrow, and as usually happens when I get to teach, I’ve learned something while reviewing the material. In this case, it’s the differences among text(), fn:string() and fn:data(). text()…