You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Narins, Josh" <jo...@lehman.com> on 2002/08/28 01:05:25 UTC

Done before?

I like XML, but not XSLT.

I like XHTML.

The only XHTML compliant templating/content management system I have seen is
in Java, it's called Java/XMLC, by enhydra.

I do not like Java, and I do not like the overall feel from the Java/XMLC
mailing list.

How does Java/XMLC work?

It works a lot like a streams(event) XML parser. All functions are called
through the id="" tag.

It's beautiful.

<table id="my_perl_func(with_args)">

As you can see, this method, unlike even the simplest of templating systems
(HTML::Template?) is 100% XHTML compliant.

This means arty people will be able to interact freely with the template.

QUESTION:

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?

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

Thank you.

:)

------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.



Re: Done before?

Posted by Perrin Harkins <pe...@elem.com>.
Narins, Josh wrote:

>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?
>  
>


Of course.  HTML_Tree 
(http://homepage.mac.com/pauljlucas/software/html_tree/) works this way 
and is mentioned in my templating guide 
(http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html). 
 There is a more recent module based on the same idea, HTML::Seamstress, 
available on CPAN.

- Perrin


Re: Done before?

Posted by jh...@mkdoc.com.
> 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/