Die onderstaande reëls van die kode uit is om die Path-xml-rekord by te werk(lêer)
SPList _list = _web.Lists[“SampleFormLib”];
MemoryStream myInStream = nuwe MemoryStream(item.File.OpenBinary());
XmlTextReader leser = nuwe XmlTextReader(myInStream);
XmlDocument doc = nuwe XmlDocument();
doc.Load(leser);
reader.Close();
myInStream.Close();
XmlNamespaceManager nameSpaceManager = nuwe XmlNamespaceManager(doc.NameTable);
nameSpaceManager.AddNamespace(“my”, “http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-06-11T12:44:57“);
doc.DocumentElement.SelectSingleNode(“my:Status”, nameSpaceManager).Inner text = “Gestoor”;
doc.DocumentElement.SelectSingleNode(“my:SaveDate”, nameSpaceManager).Innerlike Text = DateTime.Today.ToString();
System.Text.ASCIIEncoding encoding = nuwe System.Text.ASCIIEncoding();
SPFile NewFile = _web.Folders[“SampleFormLib”].Files.Add(item.File.Name.ToString(), (encoding.GetBytes(doc.OuterXml)), waar);
item.File.Update();
Maak seker dat jy voer item.File.Update() om die veranderinge te pleeg (Ek het die foute terwyl voer item.Update() and spent couple of hours to find 🙁 )
Have you considered adding some differing opinions to your article? I think it might enhance viewers understanding.