Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isXMLList(xml) { // this is needed because XML inherits from XMLList (wtf)
- if (typeof xml !== "xml") {
- return false;
- }
- if (!!xml.length()) { // if 0, xml can only be a XML list
- try {
- xml[0] = xml[0]; // throws error on all non-XML lists (don't do this with an empty XMLList though)
- } catch (ex) {
- return false;
- }
- }
- return true;
- };
Add Comment
Please, Sign In to add comment