XML Parrot Was: XML::Rules tagspec
Maurice Mengel <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
Hi, not really related to your posts, but also not completely unrelated: I looked up XML::Rules on CPAN and followed the links in the documentation. On this way I got to the idea of treating XML as lisp on perlmonks.org. Now, I wonder if one should write a grammar for XML in parrot. What would this mean? Would this be similar to the lisp idea? Would this be helpful? Would this serve as a parser? Any ideas on this? thanks Maurice On Sat, Aug 15, 2009 at 6:10 AM, Terrence Brannon<[email protected]> wrote: > Jenda Krynicky wrote: >> use XML::Rules; >> > > > 1 - perhaps you could use a few more head sections to break up the docs > under 'The Rules'. =head3 tag spec = head3 action > > and then several =head4 for each action so they can be seen from the TOC. > > 2 - but anyway I'm wondering why you cant select tags based on > attributes of the tag. And also why you cant provide a subref here that > returns true for tags matching its tests. In others, > HTML::Element::look_down can find tags by 'tagspec', but it can also > easily do various attribute tests and if that's not enough, use a sub ref. > > The reason I mention it, is that you could have two table tags in a > document and have different rules for processing each: > > sub my_table_1 { > $self->gi eq 'table' and $self->attr('table_number') == 1 > } > > my $tagspec = \&my_table_1 > > > > _______________________________________________ > Perl-XML mailing list > [email protected] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-XML mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs