nil attribute and related errors - InfoPath Dev
in

InfoPath Dev

nil attribute and related errors

Last post 04-05-2007 10:28 AM by MylesRip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-04-2007 03:42 PM

    nil attribute and related errors

    Hi,

    I have code in a browser-enabled form that clones a node to create a new sibling and then overwrites several values on the new node. On one of the fields I got the error, “Schema validation found non-data type errors.” I found a blog from the InfoPath team saying that the error could be caused by a nillable field. (Here is the link in case you are interested:http://blogs.msdn.com/infopath/archive/2006/11/28/the-xsi-nil-attribute.aspx ) As per the blog entry, I added code to remove the nil attribute.

    Unfortunately, this caused another problem. If I then try to clone the new node to create another sibling, I get the error, "Only white space characters should be used." This error only happens if you try to make a copy of a node that had the nil attribute removed from one of its member elements.

    Here is an excerpt from the code where the "white space" error shows up.

    XmlWriter writer = lastChangeOrder.InsertAfter();
    writer.WriteNode(lastChangeOrder, true); // <-- Error happens here.
    writer.Close();
    lastChangeOrder.MoveToNext();

    Any ideas? Thanks!
  • 04-05-2007 10:28 AM In reply to

    Re: nil attribute and related errors

    More information and correction...

    The connection with the nil attribute was merely coincidental. More experimentation shows that the "white space" problem shows up whenever I try to use XmlWriter.WriteNode(XPathNavigator,bool) passing in an XPathNavigator for a node that has a field which has not been assigned a value.
    Is this by design or is this a bug?
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.