Yes, the OM has changed a lot and now you have to use Navigators... here is an example:
XPathNavigator rootNavigator = this.MainDataSource.CreateNavigator();
XPathNavigator radioButtonPersonal = rootNavigator.SelectSingleNode("/my:myFields/my:radioButtonPersonal", this.NamespaceManager);
radioButtonPersonal.SetValue("2");
XPathNavigator rootNavigator = this.MainDataSource.CreateNavigator();
XPathNavigator radioButtonPersonal = rootNavigator.SelectSingleNode("/my:myFields/my:radioButtonPersonal", this.NamespaceManager);
radioButtonPersonal.SetValue("2");A few interesting points:
- Unlike in 2003, you need to pass the namespaceManager in explicitly or else prefixes such as "my" won't resolve.
- Navigators are tricky beasts - unlike IXMLDOMNode objects, they are merely pointers into the XML tree and can change under you. If you pass navigators along, it might be wise to call Clone() on them - a navigator clone is not an expensive operation.
- To get node's value, you can use the Value property, but it cannot be assigned to to set value you have to call SetValue(). The value property will be empty for inner nodes - use InnerXml instead.
Hope this helps!
David Airapetyan / Software Services ArchitectQdabra® Software / Streamline data gathering to turn process into knowledge