Skip to content

Commit

Permalink
Backport fix for issue #44 - getNamespace() does not check Attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfl committed Sep 21, 2011
1 parent 6d9dfc6 commit daeaaf5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/java/org/jdom/Element.java
Expand Up @@ -291,6 +291,15 @@ public Namespace getNamespace(final String prefix) {
}
}
}

if (attributes != null) {
for (Iterator it = attributes.iterator(); it.hasNext();) {
Attribute a = (Attribute)it.next();
if (prefix.equals(a.getNamespacePrefix())) {
return a.getNamespace();
}
}
}

// If we still don't have a match, ask the parent
if (parent instanceof Element) {
Expand Down

0 comments on commit daeaaf5

Please sign in to comment.