Ok,first off, <d> is not an aXML tag, it's merely markup used by the <db_select> tag. If you attempted to introduce a separate plugin called "d", you would get errors if you didn't use the precedence operators correctly. Having said that there are plenty of ways of putting bad data into any given parser/compiler and causing errors so that in and of itself is not a valid objection to aXML.

It is as unreasonable as saying that Perl cannot be any good because you can't call a sub "die" without interfering with the built in function "die". The given set of abstractions which I have built all work together, and can be changed as the programmer wishes, but there is a difference between extending them logically and deliberately causing conflicts between them by giving them names which interfere with each others markup space.

Secondly, yes the parser as it works right now would require that you write a tag as :

<foo><bar>moo</bar></foo> or, the preferred; <foo bar="moo"></foo>

This is a direct consequence of how the parser I have written works rather than any actual necessity of the syntax/language itself.

A compiler written as Corion suggested would allow for the use of those and of the tag schema your talking about, however as I have already mentioned all attempts I have made to write such a thing have failed miserably and I consider the task "too difficult for me", and more recenly I have come to consider the issue a waste of my time considering the technique is no longer needed for the sake of efficiency thanks to running on top of Plack.

The current code of the parser is as follows, it is a little rough around the edges at the moment because it is still under development, however it does work and it is fast.

package aXML::Parser; use Modern::Perl; use aXML::Engine; my ( $aXML,$env,$qd,$session,$cookie,$conf,$dbh,$debug_trace ); sub process { $aXML = $_[0]; $env = $_[1]; $qd = $_[2]; $session = $_[3]; $cookie + = $_[4]; $conf = $_[5]; $dbh = $_[6]; $aXML =~ s@`@<backtick>@g; my $plugins = aXML::Engine::init( $env,$qd,$session,$cookie,$conf,$ +dbh ); $aXML::Engine::scan_more = 1; my $tag_found; while ($aXML::Engine::scan_more) { $aXML::Engine::scan_more = 0; $aXML::Engine::redo = 0; $tag_found = 0; $aXML =~ s@\(([^/\s\)]+)([^\)]*?)\)@ do { if (defined $plugins +->{ $1 }) { $tag_found = 1; +"(`$1$2)" } else { "($1$2)" } } @egs; if ( $tag_found ) { while($aXML =~ s@\(`([^`\s]+)([^`\)]*?)\)([^`]*?)\(/\1\)@ d +o { my $command_args = +aXML::Engine::parse_args( "$1$2" ); my $data = $3; $data =~ s/<null>// +gs; $plugins->{ $comman +d_args->{'tag_name'} }->( $data,$command_args ); } @egs ){} } unless ( $aXML::Engine::redo ) { $tag_found = 0; $aXML =~ s@<([^/\s>]+)([^>]*?)>@ do { if (defined $plugins->{ $1 }) { $tag_found = 1; "<`$1$2>" } else { "<$1$2>" } } @egs; if ( $tag_found ) { while($aXML =~ s@<`([^`\s]+)([^`\>]*?)>([^`]*?)</\1>@ do + { my $command_args = + aXML::Engine::parse_args( "$1$2" ); my $data = $3; $data =~ s/<null>/ +/gs; $plugins->{ $comma +nd_args->{'tag_name'} }->( $data,$command_args ); } @egs ){} } } unless ( $aXML::Engine::redo ) { $tag_found = 0; $aXML =~ s@\[([^/\s\]]+)([^\]]*?)\]@ do { if (defined $plug +ins->{ $1 }) { $tag_found = 1; " +[`$1$2]" } else { "[$1$2]" } } @egs; if ( $tag_found ) { while($aXML =~ s@\[`([^`\s\]]+)([^`\]]*?)\]([^`]*?)\[/\1 +\]@ do { my $command_args + = aXML::Engine::parse_args( "$1$2" ); my $data = $3; $data =~ s/<null +>//gs; $plugins->{ $com +mand_args->{'tag_name'} }->( $data,$command_args ); } @egs ){} } } } $aXML =~ s@`@@gs; $aXML =~ s@<backtick>@`@gs; $aXML =~ s@<null>@@gs; return "$aXML $debug_trace" if $debug_trace; return $aXML; } 1;

In reply to Re^8: aXML vs TT2 by Logicus
in thread aXML vs TT2 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.