You wouldn't like my code....
My code doesn't need fixing... it needs replacing! the parser I have written implements the syntax and provides a working platform, but it is pre-alpha at best.
I just read the link you gave me and it seems similar, but the syntax I have is not quite the same as XML, as it has two extra types of tag delimiters
( ) and [ ]
I'm really shooting in the dark as to how to explain what I have, so please bear with my ignorance (not stupidity, at least I hope not).
perhaps if I gave you some more examples of the syntax itself you could understand what I am getting at... like I said the code I have which runs it ought to be deleted, and the hard drive it is stored upon melted down!
anyway...
Upon receiving a request, the existing system looks up a file in the appropriate folder called body.aXML (aXML is what I call it but I am aware that name is taken, another reason for a rethink)
listing of an example body.aXML
<html>
<head>
<title><conf>site_title</conf></title>
</head>
<body>
<use>main</use>
</body>
</html>
listing of main.aXML
<div id="comments">
<table>
(sql mode="mask")
<query>
SELECT * FROM comments;
</query>
<mask>
<tr>
<td><d>comment</d></td>
<td>[link action="showuser"
userid="<d>userid</d>"
]<d>username</d>[/link]</td>
<td><d>timestamp</d></td>
</tr>
</mask>
(/sql)
</table>
</div>
In most cases the body.aXML just contains a use tag which calls up a template, which then calls main.aXML but for simplicity I didn't bother putting that detail into the example.
The example gives an output of comments from the SQL database, the system itself takes care of connecting to the database etc, leaving the designer free to simply plug together the existing modules using the simple syntax... this massively streamlines the development of new systems, as the modules are reusable and can be stacked together in multiple different abstract ways.
for another example, here is a version of main.aXML which takes a query data argument telling it how many results to show;
<div id="comments">
<table>
(sql mode="mask")
<query>
SELECT * FROM comments LIMIT (qd)limit(/qd);
</query>
<mask>
<tr>
<td><d>comment</d></td>
<td>[link action="showuser"
userid="<d>userid</d>"
]<d>username</d>[/link]</td>
<td><d>timestamp</d></td>
</tr>
</mask>
(/sql)
</table>
</div>
Where
(qd)limit(/qd) would refer to a value passed in the query data key => value hash, under the key named "limit".
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.