On Fri, 28 Jan 2000, Perrin Harkins wrote:

> Looks almost exactly like XMLC from http://www.enhydra.org/.

        I hadn't heard of that, but, from a quick look, enhydra is
        XML/Java not HTML/Perl.  It also seems like a much more
        "involved" solution.

> It's an interesting idea to use straight HTML, since it enables you to take
> HTML generated by authoring tools and use it immediately,

        That's the exact point, yes.  :-)

        Another small benefit is it allows the web page author to see a
        mock-up page without having to have any code behind it.  Hence,
        a web site can be designed in mock-up first.

> but it seems like it does tie your program closely to the structure of the
> documents.

        It does somewhat, but much less so than existing techniques:

        1. Conventional CGI (a print-statement-laden Perl script): this
           tightly intertwines code and markup.

        2. Embedded Perl (e.g., ePerl): variables are placed at
           specific points in the markup.

        3. Non-standard tags: placed at specific points in the markup.
           (Another downside: DreamWeaver doesn't understand them.)

        So, to me, all those techniques tightly tie the document
        structure to the code.

        However, with this technique, you can move CLASS names around
        freely and NOT have to touch a single line of code.

        For example, if at first I have:

                <OL CLASS="query_db">
                <LI CLASS="fetch_next">
                    <SPAN CLASS="text::name">John Smith</SPAN>
                    &lt;<SPAN CLASS="text::email">[EMAIL PROTECTED]</SPAN>&gt;
                </OL>

        that queries a database and lists people and their e-mail
        addresses, I can then change the HTML to use a table instead:

                <TABLE CLASS="query_db">
                <TR CLASS="fetch_next">
                <TD CLASS="text::name">John Smith</TD>
                <TD CLASS="text::email">[EMAIL PROTECTED]</TD>
                </TABLE>

        and not have to touch a single line of the underlying Perl
        code.

        In theory, if the people who design the web pages using
        DreamWeaver and the Perl programmers agree on conventions for
        CLASS names in advance, the pages generated by the web
        designers should "just work."

        The "win" is being able to separate the "getting the data" part
        in the Perl code and its "presentation" part in the HTML.

> Am I correct in thinking that if you want to put a piece of text pulled from
> a database into a page you have to know exactly where it should end up in the
> HTML parse tree?

        Yes; but you control where that is by editing the HTML file.
        And you can reedit it and move it around again and again; and
        you never have to touch the underlying Perl code.  See above.

        - Paul

Reply via email to