in reply to Re^2: XPath crashing
in thread XPath crashing
It's a shame the teamid is a subtag and not an attribute, you will be unable to use the "start" rules. Which will make the script a bit slower, but not more memory hungry. In this case I think
should give you the data for the right users only.my $parser = XML::Rules->new( rules => [ _default => 'content', user => sub { return unless $_[1]->{teamid} = $_[4]->{parameters}{teamid}; delete $_[1]->{_content}; # delete the textual context (whitespace) return '@user' => $_[1]; }, users => 'pass no content', ] ); my $users = $parser->parsefile( $the_xml_file, {teamid => 100};
|
|---|