plugin produces aXML code, parser takes that aXML code and produces HTML code, browser takes that HTML code and produces text.

You've misunderstood the flow.

parser takes aXML code, parser discovers/executes valid aXML tags plugins produce either aXML or HTML or mix of both (or other) parser discovers/executes valid aXML tags plugins produce either aXML or HTML or mix of both (or other) .... parser can find no more valid aXML tags parser exits, post processing occurs browser takes finished resulting HTML and produces page

Here, I just got finished playing around with a question someone posted about processing some poorly formed HTML given that they don't know (or want to know) anything about regexs.

In aXML I would solve it like this :

(aXMLplugin name="TD")"$_[0]",(/aXMLplugin) (aXMLplugin name="TR") <db_write>INSERT INTO captured_rows VALUES (<chop><strip_tws>$_[0]</strip_tws></chop>); </db_write> (/aXMLplugin) (inc)path/to/htmldata(/inc)

The above primes two new plugins called TR and TD just for this job, then includes the html file specified and processes it adding any information it can correctly identify into a database as it goes.

The states it goes through during processing are:

State1 ------ (aXMLplugin name="TD")"$_[0]",(/aXMLplugin) (aXMLplugin name="TR") <db_write>INSERT INTO captured_rows VALUES (<chop><strip_tws>$_[0]</strip_tws></chop>); </db_write> (/aXMLplugin) (inc)path/to/htmldata(/inc) State2 ------ (aXMLplugin name="TR") <db_write>INSERT INTO captured_rows VALUES (<chop><strip_tws>$_[0]</strip_tws></chop>); </db_write> (/aXMLplugin) (inc)path/to/htmldata(/inc) State3 ------ (inc)path/to/htmldata(/inc) State4 ------ <TR> <TD> Channel </TD> <TD> Call Letters </TD> <TD> Count </TD> <TD> Percent </TD> <TD> Title </TD> </TR> ... ... State5 ------ <TR> " Channel ", " Call Letters ", " Count ", " Percent ", " Title ", </TR> ... ... State6 ------ <db_write> INSERT INTO captured_rows VALUES (<chop><strip_tws> " Channel ", " Call Letters ", " Percent ", " Title ", </strip_tws></chop>);</db_write> ... ... State7 ------ <db_write> INSERT INTO captured_rows VALUES (<chop> " Channel ", " Call Letters ", " Percent ", " Title ",</chop>);</db_write> ... ... State8 ------ <db_write> INSERT INTO captured_rows VALUES ( " Channel ", " Call Letters ", " Percent ", " Title ");</db_write> ... ...

As I'm sure you can see there are a couple of plugins there that are not in the standard set I sent to you earlier. I think it should be quite obvious to you how they would work and how you would go about adding them to the set.

Except maybe the "(aXMLplugin)" tag, which needs a little more explanation... the data it contains is returned interpolated. So:

(aXMLplugin name="greet")hello world(/aXMLplugin)

Would look like this in the plugin code it produces :

greet => sub {"hello world"},

The fact it's a one liner to be interpolated is taken as being implicit in the way I'm thinking about this plugin at the moment, such that :

(aXMLplugin name="foo")"hello world"(/aXMLplugin)

Would look like this in the code level :

foo => sub {"\"hello world\""},

And give this for output :

"hello world"

In reply to Re^9: Thanks to Ikegami, Chromatic & Corion by Logicus
in thread Thanks to Ikegami, Chromatic & Corion by Logicus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.