Dear Wendell,
declare %restxq:path("test/{$id}.html")
the RESTXQ spec. requires path segments to be either a string (such as "test") or a template (such as {$id}) [1]. If you require the .html suffix, you’ll have to remove it from the assigned variable within your XQuery code:
declare %restxq:path("test/{$id}") ... { replace($id, '.html$', '') }
Hope this helps, Christian
[1]http://www.adamretter.org.uk/papers/restful-xquery_january-2012.pdf ____________________________
%output:method("xhtml") %output:omit-xml-declaration("no") %output:doctype-public("-//W3C//DTD XHTML 1.0 Transitional//EN") %output:doctype-system("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")
function me:testing($id as xs:string) {
let $db := db:open("myDB") return
<html> <body> <h1>{$id }</h1> </body> </html>
Hitting http://localhost:8984/restxq/test/testing.html, I expect to see "testing" big and bold.
But I see "testing.html".
Any clue as to what I'm doing wrong?
Thanks, Wendell
-- Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^ _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk