$("#foo", xml) would always return an empty set, fixed (bug #877). Additionally,...
[jquery.git] / src / jquery / jquery.js
index 8a2c6b2..6f4bbe3 100644 (file)
@@ -1318,7 +1318,8 @@ jQuery.extend({
        
        // check if an element is in a XML document
        isXMLDoc: function(elem) {
-               return elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
+               return elem.documentElement && !elem.body ||
+                       elem.tagName && elem.ownerDocument && !elem.ownerDocument.body;
        },
 
        nodeName: function( elem, name ) {