cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@rsv.ricoh.com (Stephen R. Savitzky)
Subject Re: Easy to maintain Web applications?
Date Fri, 17 Dec 1999 17:19:53 GMT
Donald Ball <balld@webslingerZ.com> writes:

> I hope I'm not taking this idea out of context, but I just had to chime in
> here. What do you gain here by using your own special flow control tags
> rather than XSLT flow control tags?

It's not entirely clear we gain very much, except that I'm not sure that the
XSLT flow control tags are a complete set, and the PIA tags appear to be
more easily extended and composed, and possibly more readable (* see below).
The main thing is that we started work on the PIA long before XSLT, and even
before the XML spec was released.  It basically comes out of the programming
language tradition, not the stylesheet tradition, so the overall flavor is
very different. 

Probably the biggest difference is that nothing in the PIA allows the
definition of a element to be expanded from accessing any part of the
document outside that element.  In other words, we don't allow any reference
to nodes by ID, or any reference to the root node unless there's a
definition for it (and there usually isn't).  This means that you never have
to have a complete parse tree for the document: anything undefined just
streams through.  (**)

The net result is that the PIA's document processor is, at least
potentially, very efficient and very easy to port to other implementation
languages.

(*)For example, compare:

  <xsl:if test="expression">template</xsl:if>

with:

  <pia:if> expression 
	   <pia:then> expression </pia:then>
	   <pia:else> expression </pia:else>
  </pia:if>

In the PIA, an expression consists of any arbitrary XML.  If the user
defines a new active tag, they can use it in any expression.  XSL, in
contrast, has two kinds of "expressions", string expressions and
templates, with totally different syntax and semantics.  

Also, I didn't notice any looping construct in XSLT, though one may very
well have been added in Cocoon: in the PIA we have

  <pia:repeat>
    <pia:foreach>expression</pia:foreach>
    <pia:for><pia:start>expression</pia:start>
	     <pia:stop>expression</pia:stop>
	     <pia:step>expression</pia:step>
    </pia:for>
    <pia:while>expression</pia:while>
    <pia:until>expression</pia:until>
    <pia:first>expression</pia:first>
    <pia:finally>expression</pia:finally>
    expression
  <pia:repeat>

(optional attributes omitted for clarity).  And so on.  There's a complete
set of numeric, logical, and string operations, and the user can define new
ones (including new control structures). 

(**) It's not entirely accurate to say that we can't refer to a node by ID,
because we have include:

  <pia:extract><pia:from><pia:include src="&DOC:path;"/></pia:from>
	       <pia:id>foo</pia:id>
  <pia:extract>

-- 
Stephen R. Savitzky  <steve@rsv.ricoh.com>  <http://rsv.ricoh.com/~steve/>
Platform for Information Applications:      <http://RiSource.org/PIA/>
Chief Software Scientist, Ricoh Silicon Valley, Inc. Calif. Research Center
 voice: 650.496.5710  front desk: 650.496.5700  fax: 650.854.8740 
  home: <steve@theStarport.org> URL: http://theStarport.org/people/steve/

Mime
View raw message