Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 27416 invoked from network); 20 Jan 2005 19:58:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Jan 2005 19:58:45 -0000 Received: (qmail 94298 invoked by uid 500); 20 Jan 2005 19:58:41 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 94262 invoked by uid 500); 20 Jan 2005 19:58:41 -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 Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 94248 invoked by uid 99); 20 Jan 2005 19:58:41 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from essemtepe.nada.kth.se (HELO smtp.nada.kth.se) (130.237.222.115) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 20 Jan 2005 11:58:39 -0800 X-Authentication-Info: The sender was authenticated as danielf using PLAIN at smtp.nada.kth.se Received: from [83.226.248.219] (localhost [127.0.0.1]) (authenticated bits=0) by smtp.nada.kth.se (8.12.10/8.12.11) with ESMTP id j0KJwZlu013013; Thu, 20 Jan 2005 20:58:36 +0100 (MET) Message-ID: <41F00D7B.6030605@nada.kth.se> Date: Thu, 20 Jan 2005 20:58:51 +0100 From: Daniel Fagerstrom User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: xml languages References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Peter Hunsberger wrote: > On Thu, 20 Jan 2005 15:07:25 +0100, BURGHARD �ric > wrote: >>So is there any plan to add an xslt2.0 generator. Think about a generator >>which add some context variables (like $cocoon), or give access to >>protocols (like cocoon:/) inside in your template. There is such a generator (TraxGenerator) in scratchpad. Don't know how well it works. Nothing special is needed for XSLT 2.0, it uses AFAIK the same interface, javax.xml.transform, as XSLT 1.0. > You can already do more-or-less exactly that: just aggregate some > generators (like the request generator) and feed them to Saxon 8 > (though we use Saxon 7) as a transformer step to apply whatever > transforms you want. If you want to use XSLT 2 then use it. > > What many people seem to want is a template language other than XSLT. > Personally, I agree that that seems to be re-inventing the wheel, but > open source communities seem to like constant mutant evolution... The problem with using XSLT as template language is that it is hard to get pull access to Java beans. You can of course serialize your Java object to SAX with e.g. Castor or Betwixt in a generator or a source. But that soon becomes expensive if you just want to access a little data from a large Java object. What you need is some kind of lazy DOM adapter for the Java beans, that only access the parts of the bean that correspond to the parts of the DOM that is accessed by the XSLT processor. There is such a DOM adapter (o.a.c.components.jxdom.DocumentAdapter) in scratchpad. Don't know about the quality of that either. Chris Oliver wrote the TraxGenerator and the DocumentAdapter during the "In search of the perfect template language" thread that I cited in my previous mail. But he lost his belief in that approach and wrote JXTG instead. I also spent consideral time in refactoring Betwixt to be able to become a lazy DOMAdapter. But didn't have time to finish it. My current view is that it would be nice to be able to use XQuery or XSLT 2.0 on Java bean structure, but that it require considerable work to make it work well with current implementations. And I don't feel that itch anymore. /Daniel