Hi I am having an issue with an infopath project I have built and was running for a good 6 months before the issue arose.
The code all runs as should on infoPath 2010 where the form and code were built but they were built in 2007 compatibility mode as my client who uses the form only has access to 2007 but it no longer works on 2007. I don't know what I have done and I have tried going through it with a couple of colleagues and cant seem to figure it out as even using the old code and form before the change no longer work. I have also tested on infoPath 2013 and it gives me the same MSXML error. I have tried a couple of different things I have found on google but with no avail. If I change the namespace for 'my' it breaks my code completely.
This is the change I made which started the problems but I have tried removing and even pulling and old version of the form and code from subversion and still have the same issue.
notes = item.SelectSingleNode("ows_Notes", NamespaceManager).Value;
to this
notes = Microsoft.SharePoint.Utilities.SPHttpUtility.ConvertSimpleHtmlToText(item.SelectSingleNode("@ows_Notes", NamespaceManager).Value, -1);
notes = Regex.Replace(notes, @"\r\n?|\n", "");
notes = TrimWhitespace(notes);
But this is where the error occurs. Its not just this section its everytime I try to write to any of the variables in the form in this way.
using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group6", NamespaceManager).AppendChild())
{
writer.WriteStartElement("group7", myNamespace);
writer.WriteElementString("visitors_name", myNamespace, visitor_name);
writer.WriteElementString("group_name", myNamespace, groupName);
writer.WriteElementString("confidential", myNamespace, confidential);
writer.WriteElementString("company", myNamespace, company);
writer.WriteElementString("arrival_time", myNamespace, arrival);
writer.WriteElementString("host", myNamespace, host);
writer.WriteElementString("host_phone", myNamespace, hostPhone);
writer.WriteElementString("host_department", myNamespace, hostDepartment);
writer.WriteElementString("reason", myNamespace, reason);
writer.WriteElementString("created_by", myNamespace, createdBy);
writer.WriteElementString("ID", myNamespace, ID);
writer.WriteElementString("picSelect", myNamespace, http://xsappsuk.bmwgroup.net/sites/PA7/SiteCollectionImages/blank.jpg);
writer.WriteElementString("listNotes", myNamespace, notes);
writer.WriteEndElement(); writer.Close();
}
Please any help on the matter would be greatly appreciated.