perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <jhi...@mkdoc.com>
Subject Re: Done before?
Date Tue, 28 Aug 2001 06:57:09 GMT
> I like XML, but not XSLT.
Same here.

> I like XHTML.
It's only slightly less horrible than HTML but yeah... shame that XHTML 1.1
has to be served as application/xml, which no version of IE supports :-(

> The only XHTML compliant templating/content management system I have
> seen is in Java, it's called Java/XMLC, by enhydra.
Interesting, I'll have to take a look.

> I do not like Java, and I do not like the overall feel from the Java/XMLC
> mailing list.
Hey, Java is cool. It's just that Perl is Way Better :-)

> Before I proceed, are there ANY content management/templating systems that
> RELY EXCLUSIVELY on TAG ATTRIBUTE (name="value") nomenclature
> to allow interaction between template and perl code?

I wrote a module inspired by the Zope Page Template TAL specification [1]
which uses only tag attributes. It can process XML (using XML::Parser)  or
HTML (using HTML::TreeBuilder), and outputs either XML or more
specifically XHTML (for tags like input or br which __HAVE__ to be self
closing)...

The module is called Petal (for Perl TAL). It's on CPAN. [2]. It's still
under
development but it's getting very workable now. There is also a Petal
mailing
list [3].

> Are there any that don't follow that model, but are 100% XHTML compliant?

Petal uses extra attributes which you can declare a namespace for. For
example,
let's say that you have the following object.

package Node;

sub parent();
sub children();
sub id();
sub title();


Here is a fragment of Petal code that could operate on the following
structure:

<h1 petal:content="here/title">Current node title</h1>
<div petal:condition="true:here/children">
  <p>List of child nodes:</p>
  <ul>
    <li id="someDummyID"
         petal:repeat="child here/children"
         petal:content="encode:here/title"
         petal:attributes="id string:${here/id}-node">Dummy node Title for
WYSIWYG editors</li>
    </li>
  </ul>
</div>

You can send this to HTML tidy, or use frontpage and dreamweaver, and
attributes will be
preserved. There are many more features to Petal, but it's all documented as
POD and there
are many use cases on the mailing list archives.

[1] http://www.zope.org/Wikis/DevSite/Projects/ZPT/TAL
[2] http://www.cpan.org/authors/id/J/JH/JHIVER/
[3] http://lists.webarch.co.uk/pipermail/petal/

Cheers,
--
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
  Jean-Michel Hiver - Software Director
  jhiver@mkdoc.com
 +44 (0)114 255 8097
================================================================
VISIT HTTP://WWW.MKDOC.COM - Don't visit http://www.webmatrix.net/


Mime
View raw message