# substitution: see if this element matches anything. if so,
# descend down into the tree.
if (ref($obj) eq 'HASH') {
+ # first of all, see if we have an attribute match.
+ for my $key (keys %$obj) {
+ next unless ($key =~ /^(#?)(.*)\/(.*)$/);
+ my ($idmarker, $name, $attr) = ($1, $2, $3);
+
+ if (($idmarker eq '#' && $id eq $name) ||
+ ($idmarker ne '#' && $data->{'LocalName'} eq $name)) {
+ $data->{'Attributes'}->{$attr} = {
+ Prefix => '',
+ LocalName => $attr,
+ Name => $attr,
+ NamespaceURI => '',
+ Value => $obj->{$key}
+ };
+ }
+ }
+
my $match = undef;
for my $key (keys %$obj) {
if ($key =~ /^#(.*)$/) {