I'm doing some researching using XQuery (Qexo) together with SnipSnap. This should make it possible both using content from SnipSnap as input and having the XQuery code stored in a snip. Qexo in SnipSnap
I would really like to see a snip stored as XML and that all the annotations and macro's are in XML format too. The advantages are that you can use XSL transformation to have more freedom in the page layout than with CSS only. It would also make it possible to query the snip contents.This is of course less convenient for users that want to enter some text quickly. But if you use radeox to render the convenient notation into nice XML, we can have best of both.I am thinking about experimenting with a filter to do the XSL transformation.
@koert: Do that if you like. We've been on the XML-train and well … it was to shaky for us. But the file backend will be flexible in serializing snips. So XML/XSL for web content is a no-no for us. But the new RenderLabel can contain a different renderer instead of Radeox->HTML you can supply XML->(XSL)->HTML. No problem.
I know the problems with XML/XSLT. XSL can become very complex quickly and transformation is not very fast. But it does give great flexibility and improves the seperation the content from the presentation. The experiment will show if it's a good idea or not.
@senikk: do you intend to expose the snipspace as XML for qexo queries? I'd love to map an XPath/XQuery engine to the entire snipspace, but that seems a daunting task unless you require XML-based stores.
@phobia: I think I will use the new rdf feature of the CVS version of SnipSnap (0.5) which makes it possible to use the xquery doc() function like doc("http://senikk.com/rdf/senikk")So what could this be used for? Here are some ideas:
Joining content from several snips or joining it with other xml data
Making wml version (Also known as WAP)
If also s:labels had been added to the snip xml namespace it would have been easy to make foaf from a user's snip
Since Qexo scripts can compile into servlets its possible to just add an .xql mapping to web.xml and adding the kawa-1.7.jar to the lib directory.Qexo also have the possibility to compile on demand so its just to add the xql script to the server and run it just as easily as you would do with script languages such as php, asp or jsp.I written some more using Qexo together with SnipSnap here: Qexo in SnipSnap
I love the possibilities that opens, but it still constrains operations to one snip at a time. I can't use an XQuery to find, for example, all snips with a date label with this approach, or use XSL to consolidate multiple snips.
but it still constrains operations to one snip at a time
No, you can use several doc() and join them but you have to write the names of the snips.
I can't use an XQuery to find, for example, all snips with a date label with this approach
I think I have to do some thinking how this could be solved.update
Use lucene search in url to a servlet returning a list of matching snip names which you can use in a loop and read all content by doc(.../$name) example with a label: ...?query=xmppID:senikk*
Make a servlet returning all snipsnap names and labels as a xml document
Outputting the entire snipspace as an XML instance document would work, but will not scale.My personal needs will be met by Lucene queries provided label support is there. I really would like to see XPath/XQuery mappings to the entire snipspace, though, so we can use metadata within snip content, as well.Udell's examples are good. If I use a {quote} macro that lets me specify an author parameter (attribute), then I want to be able to search for (or report in aggregate) all snips that contains quotes from a particular author.In the present architecture, it seems that will require the quote macro to add "cited" labels. Not all metadata needs to be promoted into snipspace structure, though!
Outputting the entire snipspace as an XML instance document would work, but will not scale.
Yes, ofcourse this could be done if you only wants to create some new static content with use of XQuery.
My personal needs will be met by Lucene queries provided label support is there.
I think it will suite my needs as well and I think it would be easy to implement.
provided label support is there
I thought I have read somewhere that label search like type:summary was implemented in the CVS version, but I didn't get it working, maybe I'll have to do a cvs update.
What is SnipSnap?
SnipSnap is a free and easy to install weblog and wiki tool written in Java.
Current version: 1.0b3-uttoxeter Try our Web Start Demo!Resources
- Joining content from several snips or joining it with other xml data
- Making wml version (Also known as WAP)
- If also s:labels had been added to the snip xml namespace it would have been easy to make foaf from a user's snip
Since Qexo scripts can compile into servlets its possible to just add an .xql mapping to web.xml and adding the kawa-1.7.jar to the lib directory.Qexo also have the possibility to compile on demand so its just to add the xql script to the server and run it just as easily as you would do with script languages such as php, asp or jsp.I written some more using Qexo together with SnipSnap here: Qexo in SnipSnap