that line should read:
thisXDocument.GetNamedNodeProperty(nodeSection,'completed','no value')="1";
It appears you are getting a few completely different things mixed up. GetNamedNodeProperty is entirely different, and has nothing to do with DOM Attributes.
If you want to set an attribute, you can do something like:
thisXDocument.DOM.selectSingleNode("/my:myFields/my:section/@completed").text = "{new value}"
Where {new value} is one of the two boolean values you are using (i.e. 1/0 or true/false).

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
is there a Best Practice method for changing a checkbox attached to an
attribute?
if my section contains the attribute "completed", a true/false attribute,
should I be using:
C#
IXMLDOMNode nodeSection=
thisXDocument.Dom.SelectNode("/my:myFields/my:section")
thisXDocument.GetNamedNodeProperty(nodeSection,'completed','no value');
or
nodeSelection.attributes.setNamedItem('completed')="1" ?
(I ask because I've not managed to get either of thse methods to work.)
thanks,
nick
nick brandwood - 02 Mar 2005 08:51 GMT
now I see how it works!
I had made a mistake in my xpath and given up on this route.
thanks!
nick
> It appears you are getting a few completely different things mixed up. GetNamedNodeProperty is entirely different, and has nothing to do with DOM Attributes.
>
[quoted text clipped - 26 lines]
>
> nick
nick brandwood - 02 Mar 2005 09:49 GMT
in case anyone else is reading this conversation, the correct command was:
thisXDocument.DOM.selectSingleNode("/my:myFields/my:richiesta/@my:completed").text = "1";
my:richiesta is a group with the attribute completed.
note the namespace 'my:' before the attribute name.
thanks Greg!