Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 77464 invoked from network); 15 Mar 2008 07:28:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2008 07:28:21 -0000 Received: (qmail 45038 invoked by uid 500); 15 Mar 2008 07:28:17 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 44964 invoked by uid 500); 15 Mar 2008 07:28:17 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 44953 invoked by uid 99); 15 Mar 2008 07:28:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Mar 2008 00:28:16 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [84.14.163.131] (HELO trinity.anyware-tech.com) (84.14.163.131) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Mar 2008 07:27:25 +0000 Received: from localhost (localhost [127.0.0.1]) by trinity.anyware-tech.com (Postfix) with ESMTP id AD58C400BCF for ; Sat, 15 Mar 2008 08:27:45 +0100 (CET) Received: from trinity.anyware-tech.com ([127.0.0.1]) by localhost (trinity.anyware-tech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07839-03 for ; Sat, 15 Mar 2008 08:27:34 +0100 (CET) Received: from poukram.local (lns-bzn-51f-81-56-134-235.adsl.proxad.net [81.56.134.235]) by trinity.anyware-tech.com (Postfix) with ESMTP id 6DAB4400122 for ; Sat, 15 Mar 2008 08:27:34 +0100 (CET) Message-ID: <47DB7A65.7030506@apache.org> Date: Sat, 15 Mar 2008 08:27:33 +0100 From: Sylvain Wallez User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Micro-Cocoon ... Corona References: <4777C8C7.6060807@apache.org> <47D94AE8.7010900@apache.org> <47D973C1.3080106@tuffmail.com> <47D9A1F7.2060609@gmx.at> <47DABC21.8010007@apache.org> In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Debian amavisd-new at anyware-tech.com X-Virus-Checked: Checked by ClamAV on apache.org Luca Morandini wrote: > Sylvain Wallez wrote: >> >> So we can take a different approach, and consider that we can use >> plain programming languages rather than grow our own >> "pseudo-languages". A well-defined Java API and its Javascript >> binding would make people way more productive than an XML-based >> language like the sitemap. > > Do you mind terribly showing me an example of the use of this API ? > > Something like: > CocooonStream stream= new CocoonStream("file", "documents/mydoc.xml"); > stream.transform("xslt", "xsl/doc2html.xsl"); > return stream.serialize("html"); Yes, something like that. But add in the mix the often discussed content-aware selection (see [1] for the Flickr API): CocoonStream stream = new CocoonStream("url", "http://api.flickr.com/services/rest/?method=flickr.test.echo&name=foo"); if (stream.inspect("xpath", "/rsp[@stat='ok']")) { doSomeUsefulApplicationStuff(); stream.transform("xslt", "xsl/flickr-success.xsl"); } else { stream.transform("xslt", "xsl/flickr-error.xsl"); } return stream.serialize("html"); > I understand the usefulness of having a programmatic API and this > approach plays well with the Java monoculture, but, there aren't > libraries already doing that ? I don't think we're talking about monoculture here, but about avoiding the clumsyness of a reinventing a real programming language in XML. Such an API can be mapped to the language of your choice: Javascript, Python, Ruby, Scala or whatever language is available on the JVM, including but not limited to the sitemap. About existing APIs, javax.xml.transform addresses part of it (it doesn't have stream inspection though) but it often perceived as difficult to grasp from the simple fact that you have to wire the pipeline backwards, starting with the serializer. Sylvain [1] http://www.flickr.com/services/api/request.rest.html -- Sylvain Wallez - http://bluxte.net