text: Results 1 to 1 of 1
  - Join Date
  - May 2002
  - Location
  - Hayward, CA
  - 1,496
  - Thanks
  - 1
  - Thanked 24 Times in 22 Posts
  Determining if document is XML in Gecko
  Sometimes it matters if a document is an XML document or not -- or, more accurately, if Mozilla, Netscape, KMeleon, and family will treat a document as XML.
  For instance, I'm building a widget to create nodes in the DOM, but HTML documents don't allow namespaces. XHTML as XML does.
  Code:
  function docIsXML(doc) { var ifaces = Components.interfaces; return ((doc instanceof ifaces.nsIDOMXMLDocument)||(doc instanceof ifaces.nsIDOMXULDocument)); }"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
  June 30, 2001
  author, ES7-Membrane project (Github Pages site)
  author, Verbosio prototype XML Editor
  author, JavaScript Developer's Dictionary