Hi again,
Yes, as I understand it Marco's request is the complementary opposite of mine, where in
repository/{$path}/resource
$path could match not only a path segment, but an arbitrary sequence of segments (which can be decomposed by the function when need be).
Because it matches on substrings not path segments, Apache Cocoon can do this and indeed it's very powerful.
But I understand we're talking about feature requests in RestXQ, not in BaseX. I'm happy enough for now with the workarounds. :-)
Cheers, Wendell
On Wed, Feb 27, 2013 at 3:11 AM, Marco Lettere marco.lettere@dedalus.eu wrote:
Hello, I'd like to add just my two cents to the discussion. We have to implement a specification called hData that stores healthcare data in document oriented way. The specs organizes the documents in a tree structure based on record/section/subsection/subsection/... where subsections can be arbitrarily nested. RestXQ is nearly perfect for this spec the only thing that we miss is the possibility to refer to arbitrary subsections in the path. We have to limit the access to a predefined level of subsections because there's no way AFAIK to refer to an arbitrary path. Is this right? Could this be solved in your opinion with accessing inside the function the path info through the request module (request:path())? Thank you, M.
On 02/26/2013 11:31 PM, Christian Grün wrote:
Hi Wendell,
in our use case, we never work with file extensions in the URI, so we didn’t actually felt that this could be a restriction. Still, I agree that a more powerful path matcher could add flexibility. RESTXQ is still pretty young, so just wait and see how the standard evolves.
Best, Christian ___________________________
On Tue, Feb 26, 2013 at 11:20 PM, Wendell Piez wapiez@wendellpiez.com wrote:
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 christian.gruen@gmail.com 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 BaseX-Talk@mailman.uni-konstanz.de 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 BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de 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_^