Christian,

Ah, how ... non-obvious. "Path segment." :-> (Expecting more flexible
string-matching behavior, a la Cocoon sitemaps, I guess I didn't even
notice the language saying it wasn't.)

Thanks! I guess I can live with a little working around, if it makes
life easier for others.

Cheers, Wendell


On Tue, Feb 26, 2013 at 12:30 PM, Christian Grün
<[email protected]> wrote:
> 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
>> [email protected]
>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk



--
Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables
_____oo_________o_o___ooooo____ooooooo_^
_______________________________________________
BaseX-Talk mailing list
[email protected]
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

Reply via email to