Skip to content

Instantly share code, notes, and snippets.

@lopnor
Created August 31, 2009 03:47
Show Gist options
  • Save lopnor/178272 to your computer and use it in GitHub Desktop.
Save lopnor/178272 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Test::More;
use Data::Dumper;
#sub XML::LibXML::bootstrap{ die }
BEGIN {
unshift @INC, sub {die if $_[0] eq 'XML::LibXML'; return};
}
use XML::Atom::Entry;
my $xml = <<END;
<?xml version='1.0' encoding='utf-8'?>
<entry xmlns='http://www.w3c.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'
gd:etag='&quot;hoge&quot;'>
</entry>
END
{
my $atom = XML::Atom::Entry->new(\$xml);
isa_ok $atom->elem, 'XML::XPath::Node::Element';
# my $etag = $atom->elem->getAttributeNS('http://schemas.google.com/g/2005', 'etag');
my $etag = $atom->elem->getAttribute('gd:etag');
is $etag, '"hoge"';
}
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment