InfoPath error to mix MSXML - InfoPath Dev
in

InfoPath Dev

InfoPath error to mix MSXML

Last post 01-06-2015 07:37 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-06-2015 01:43 AM

    • cald88
    • Not Ranked
    • Joined on 01-06-2015
    • Posts 2

    InfoPath error to mix MSXML

    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.

  • 01-06-2015 07:26 AM In reply to

    Re: InfoPath error to mix MSXML

    What is the exact error message?

    Hilary Stoupa

  • 01-06-2015 07:33 AM In reply to

    • cald88
    • Not Ranked
    • Joined on 01-06-2015
    • Posts 2

    Re: InfoPath error to mix MSXML

    Hi the exact error message was just 'It is an error to mix versions of MSXML' I have resolved the issue it turns out it was something to do with my infopath installation on my own machine. Not too sure what went wrong but I opened to code on another machine and it ran straight away but still get the error on my machine. I am in the process of uninstalling and re-installing both versions of infopath on my machine to try and over come the issue.

     

    Thanks for your reply.

  • 01-06-2015 07:37 AM In reply to

    Re: InfoPath error to mix MSXML

    You don't happen to have multiple versions of InfoPath installed on the machine, do you? I think we've seen this in the past with IP 2007 & IP 2010 installed on the same machine.

    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.