> XML syntax is crufty at best.  It requires you to be strict and tediously
> correct with every character.

So what. It's not like you can afford to forget that many curly braces
or semicolons (well, except those at the end of a block) with Perl. That
doesn't make it useless does it?


> You have to shoe-horn the semantics of your complex directives into
> the limited syntax of element-name-and-attributes.

If you're crazy enough to use XML as a programming language, I have to
agree with you. XML really sucks at that. However as a data exchange
format I think it's fine.

I think the same idea is behind AxKit's XPathScript. Let's use
programming languages to program, and XML as a vector to structure and
transport data.


> The language becomes contrived and clumsy as a result of trying to satisfy 
> a purity of design and you find yourself tied down to only generating valid
> XML (which few real world web pages are, even if they should be).

Well, I see Petal's ability to help you generating valid XML webpages as
a good thing. I do not recommend Petal to people who are interested in
generating HTML 3.2 pages full of tables, font face tags, fixed width
fonts and other javascripteries. They would be very disapointed.


> The templates becomes harder to read and write because they're
> designed to satisfy an XML parser rather than a human.  By using XML
> directives in XML markup, you ensure that the directives are
> camouflaged nicely and blend into the background.  This is precisely
> what you (well, I) don't want to happen.  These directives are
> supposed to be important - they are a separate concern from the purely
> declarative markup surrounding and deserve to stand out from the
> crowd.

I suppose that's one way of seing it. The problem is that your template
then looks like a programming language, which kind of defeats the
purpose of having a template in the first place.

I suppose that Petal is philosophically closer to HTML_Tree, except it
has a much gentler learning curve IMHO.


> This is all personal opinion, of course.

Same here :)


> I drank the XML kool aid for a long time, until I realised it was
> nothing but water, sugar and artifical colours.  XML still serves a
> useful purpose for many things, but it's not the uber-solution to all
> our problems that vendors of commercial XML software would have us
> believe. Just because you can write programs, or SQL queries, or
> templates using XML, doesn't mean that you should.

I agree on that.


> For the record, Petal looks like a well implemented template module,
> and I'm glad to see another high-calibre one joining the collective.
> I've looked at TAL before and while I understand the design philosophy
> that they're trying to promote, I still not that impressed because I
> can see what look like gaping holes in the reasoning behind it.


Maybe... It's a little bit strange when you get started with it, but
it becomes clear and very elegant quite quickly. For example with a
traditional mini-language kind of templating system, you might have
something like:

  <div dir="<!--VAR language_dir -->">
    <!--VAR some_content-->
  </div>

Which is completely impossible to validate and IMHO very hard to read.


With Petal you just start with a mockup:

  <div dir="ltr">
    Hello, World
  </div>


And then you add TAL instructions:

  <div
    dir="ltr"
    petal:attributes="ltr language_dir"
    petal:content="some_content">
  >
    Hello, World
  </div>


If you like a more straightforward approach, Petal also lets you write:

  <div dir="$language_dir">
    $some_content
  </div>

But at the risk of breaking compatibility with some validators / XML
tools / etc.


> Vive la difference!

Entierement d'accord :)
Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
[EMAIL PROTECTED]  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/

Reply via email to