I noticed and solved this problem years ago. There are a bunch of ways it can be done. Your quite right that this is a special case and your quite right that it needs a special solution.
Solution 1In aXML tags delimited by brackets of type ( ) (/) compute prior to their child tags unless their child tags are also of type ( ) (/)
(ignore) <db_select> <query>.... ... ... </db_select> (/ignore)
Where the ignore plugin takes all the data within it's scope, stores them in a memory location and inserts a special token which directs the parser to reinsert that data at that position immediately prior to exit after the processing of the rest of the document is complete.
Solution 2Let's make the problem harder; we want to output a fragment of aXML which contains tags of type ( ) (/)
For instance:
(db_select) <query>... ... ... (/db_select)
Clearly if we use the above method, the (db_select) (/db_select) tag will be computed prior to the (ignore) tag, in accordance with the rules of precedence for the tag types. In this case we need to seperate the data off into another file and insert the token which triggers the post processing inclusion routine mentioned above.
We can do that by having a plugin called something like <post_inc> or <delay_include> or whatever, which takes a path to file which is to be included at the end without being processed. This tag loads the file, stores the data in memory and inserts the appropriate special token the same as above.
Solution 3Let's say you don't want to use a separate file for some reason, perhaps you dislike having lots of small data files and you prefer a more monolithic approach. (*note1 see below)
You can simply convert the brackets to the html standard for special chars :
<db_select> <query> SELECT * FROM users </query> ... ... </db_select>
The parser will then pass straight over it because it will not consider the string to contain any valid tags.
Since you can also use tags of type ( ) (/) and [ ] [/] in aXML you have 4 extra specials in accordance with the same rules you have for html:
[ ] [/] becomes &lsb; &rsb; &lsb;/&rsb; ( ) (/) becomes &lb; &rb; &lb;/&rb;
I'm pretty sure this covers all the bases, and I haven't needed anything more esoteric than that yet in over 4 years of using aXML.
In reply to Re^12: aXML vs TT2
by Logicus
in thread aXML vs TT2
by Logicus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |