Yes, probably. Here is a code snippet from the very top of my JScript file. You MUST declare your namespaces and reference them any time you are using XPath in any function or anything else, at least from my experience. Anyway the xmlns:xsi and xmlns:xd are standard and should be included in your file. The other namespaces can be found by double-clicking on a control and going to the "advanced" tab. You should find the namespace there.
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://www.w3.org/1999/xhtml" xmlns:ns1="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-22T14:26:27" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-08-23T19:14:40" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003"');
//</namespacesDefinition>
If all else fails, you could copy all your JScript code from you .js file, put it in notepad for a second, extract your form to files, delete the .js file there, re-publish into XSN and then go to Tools -> Programming -> Microsoft Script Editor. This should get you back to an original .js file with all the MS auto-generated stuff in it.
---------------
Matt Faus
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge