Guest User

Untitled

a guest
Jul 18th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function isXMLList(xml) { // this is needed because XML inherits from XMLList (wtf)
  2. if (typeof xml !== "xml") {
  3. return false;
  4. }
  5. if (!!xml.length()) { // if 0, xml can only be a XML list
  6. try {
  7. xml[0] = xml[0]; // throws error on all non-XML lists (don't do this with an empty XMLList though)
  8. } catch (ex) {
  9. return false;
  10. }
  11. }
  12. return true;
  13. };
Add Comment
Please, Sign In to add comment