'XDocument.DOM.selectSingleNode(...)'is null or not an object File:script'js - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

'XDocument.DOM.selectSingleNode(...)'is null or not an object File:script'js

Last post 03-26-2009 12:29 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-26-2009 09:34 AM

    'XDocument.DOM.selectSingleNode(...)'is null or not an object File:script'js

    I am getting the below error whan trying to access a field on my form.

    'XDocument.DOM.selectSingleNode(...)'is null or not an object File:script'js 

    My namespace is set as...

    XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-03-24T12:18:15" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');

     my code is...

    XDocument.DOM.selectSingleNode( "/dfs:myFields/my:LastName" ).text = " ";

    My Datasource looks like this...

    myFields

       LastName

       FirstName

    Does anyone see what I am doing wrong...I know it is a simple fix?

     

     

    Filed under:
  • 03-26-2009 12:29 PM In reply to

    Re: 'XDocument.DOM.selectSingleNode(...)'is null or not an object File:script'js

    Catching this up to our email thread -- the namespaces are incorrect in the xpath. If you don't have IP 2007 with its wonderful Copy XPath capability, you can save your form as source files and look at template.xml in a text editor to see what the correct namespaces are for your xpath.

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.