Starting fresh


I spent almost all day yesterday trying to figure out why one function worked, and what I thought was pretty much an exact duplicate, tweaked to pull different elements, didn’t–I was pretty frazzled by the end of it, and I think I need to start fresh today (I did put another call out on the exist-db mailing list, and maybe that will yield some insight).

In the meantime, I realize that my lack of vocabulary (what’s a model? what’s a map? what’s a node? lions and tigers and bears!) is a problem. While I’m not going to fix that overnight, I did pull up the W3C recommendations on XQuery 3.0–that will stay open for browsing.

Start from scratch: that’s my plan for today. I’m going to try to write and call a function that just prints out something where I want it to be.


And here’s what I have!

declare function app:test($node as node(), $model as map(*)) {
let $work := $model(“work”)
<p xmlns=””>
{ $work/tei:text/tei:body/tei:p/text() }

The bit in the curly brackets didn’t do diddly, but I did get the word “Testing” to appear beneath the header of my document! I’d say that’s progress for the morning.

Woo hoo!

Leave a Reply

Your email address will not be published. Required fields are marked *