title: How can I intercept the result of openDocument before NSDocument loads?
body: <p>I am writing a program which will load and process XML data.  If the XML file contains a single XML 'Dictionary' then it will need to open an NSDocument window (so far, so good - I can do this!), but if the XML file contains an array of Dictionaries then it should open up a list window, from which the individual Dictionaries can be opened into an NSDocument.</p>
  
  <p>Because <strong>File->Open</strong> sends an action to <strong>First Responder->openDocument</strong> before the document window opens, I think that the openDocument function is not part of NSDocument.  I'd like, therefore, to be able to intercept the open function before it hands off to NSDocument - just to check if the document is one that I want to be opening as a document rather than as my natty list view.</p>
  
  <p>If, on the other hand, openDocument is an NSDocument function, how can I quietly close the NSDocument window and hand the XML list to my list window without raising an error in this one scenario?  Of course, I don't want to suppress errors altogether - because there may be legitimate reasons to raise an error (unreadable file, bad syntax etc)</p>
  
  <p>I realise that what I'm trying to do is a little unorthodox - but hopefully its possible.  Any ideas?</p>