in reply to Parsing xml:lang attribute

So far, I haven't been able to extract the xml:lang attribute using XML::Parser. It seems to ignore attributes with the xml: prefix.
My experience doesn't match yours. I can clearly see the attribute 'xml:lang' in the list of attributes.
use XML::Parser; use Data::Dumper; my $parser = XML::Parser->new(Handlers => { Start => sub { print Dumper [ @_[1 .. $#_] ] } } ); $parser->parse(\*DATA); __DATA__ <FILE> <FOO xml:lang="en"> <BAR/> </FOO> <FOO xml:lang="ru"> <BAR/> </FOO> </FILE>
Result:
$VAR1 = [ 'FILE' ]; $VAR1 = [ 'FOO', 'xml:lang', 'en' ]; $VAR1 = [ 'BAR' ]; $VAR1 = [ 'FOO', 'xml:lang', 'ru' ]; $VAR1 = [ 'BAR' ];
Anyway: you might be interested in using a parser that can handle XPath, as it might make filtering out just the contents you want, just a little bit easier.

Although personally, I think XML::Parser is fine... :)