jscript question

  • Thread starter msnews.mircrosoft.com
  • Start date
M

msnews.mircrosoft.com

The following line of code

var xmlNode = XDocument.DOM.documentElement.selectSingleNode("my:Date1");
if (xmlNode.getAttribute("xsi:nil")) xmlNode.removeAttribute("xsi:nil");
xmlNode.text = getDateString(now);

works on one infopath form but not on another one. I get a null error, like
it is not finding my:Date1 in the list of data sources (which it is) I am
almost positve that my:Date1 is correct -- I used the expression box to
verify that.

My question is what does the second line of this code do -- xsi:nil ?? any
other ideas why it would be erroring.

Thanks
SR
 
J

Josh Bertsch [MSFT]

First, try selectSingleNode("//my:Date1").

xsi:nil is an attribute but on certain node types where the value can not
inherently be blank. Check to make sure that the data type of my:Date1 in
your non-working example is the same as the data type of your working
example.

--josh bertsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top