Hi! look if you dont wanna read about a heretical possibly insane abuse of the xml format, skip this thread now...
ok still here? good good!
right ok ive been building a CGI system _ gasp _ yes handrolled!! and its composed of 3 basic components
action.pl # the "kernal"
action files # the controlling code
plugin files # code modules which do the actual work
ok all pages on my sites are generated from action files, which strongly resemble html, but can have tags embedded in them which can call the plugin functions, and therefore perform any number of server side tasks while the page is being processed by the action.pl
the intent was to build a system wherein plugins can be arranged by an xml schema to interact, handing each other variables and sending their output to the end document, such that an end user need only arrange the tags right to build complex web applications out of a range of simple plugin "blocks".... bit like a lego set for CGI.
here comes the heresy bit! ive gone and made my system support not just the <> tags, but also another two types of tags [] and () ... and this is where lots of people are shaking their heads already... but really folks! i been using this system for a while now and its great...
let me try and explain... for there is method in my madness and i would really like to get this idea to the table in a format where people can weigh its merits on the idea itself rather than my crude implementation...
ok... under the schema im working with brackets are typically computed from the inside outwards and tags can appear at _any_ position within each other.... such that;
<link action="<qd>action</qd>">a hyperlink</link>
note the qd tag is embedded inside the link tag? both are plugins. the qd tag fetches info from the query data hash table, and the link tag builds a hyperlink to another action file, passing vars along such as sessionid etc.
then what are these extra brackets for? well consider this code ;
<case c="<qd>whichfile</qd>">
<file1>
<insertfile>file1.xml</insertfile>
</file1>
<file2>
<insertfile>file2.xml</insertfile>
</file2>
</case>
now you may of noticed two things; first that it inserts both files before disgarding one of them, which is inefficient and also there is an easier way to do this example, but it is just an example so dont worry too much...
ok with our extra tags... () = do these before considering <> & [] and [] = do these last we can clear up this inefficiency in several ways;
(case c="(qd)whichfile(/qd)")
<file1><insertfile>....
<file2...
(/case)
or
<case c="<qd>whichfile</qd>">
<file1>[insertfile]...
<file2>[ins...
</case>
and for the nitpickers just a simple
<insertfile><qd>whichfile</qd>.xml</insertfile>
will also do.. but doesnt get at what i was trying to illustrate.... this schema may seem heretically stupid at first but give it some thought, you will see it brings a lot to the table in terms of how webpages are built...
oh i can already hear some of u screaming at me to use standards... arghhhh! this is one of those suck it and see type situations; i cant justify the system without lots of examples and such, and if you dont get the jist of what im trying to do then it wont look like a good idea.
ps. i didnt know where to post this, im just trying to give away my ideas in an opensource altruistic manner so plz dont be too negative :)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.