Subject: | error in child_allowed |
The child_allowed command returns true sometimes when the child is actually not allowed in the tag. This is the case for example if you check for the allowability of a child named "bar" in an element that can contain elemnet "foobar".
I've provided a patch that solved the problem for me.
--- /usr/lib/perl5/site_perl/5.8.1/XML/ParseDTD.pm 2003-12-06 17:39:45.000000000 -0500
+++ script/XML/ParseDTD.pm 2004-02-05 15:19:24.000000000 -0500
@@ -216,7 +216,7 @@
sub child_allowed {
my($self,$tag,$child) = @_;
$self->_set_errstr(1,$tag) and return 0 unless($self->{'Element'}->{$tag});
- return 1 if (eval("'" . $self->{'Element'}->{$tag} . "'" . "=~ m/($child,)/"));
+ return 1 if (eval("'" . $self->{'Element'}->{$tag} . "'" . "=~ m/\\($child,\\)/"));
$self->_set_errstr(4,$child,$tag);
return 0;
}