{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/AL/issues/1553","repository_url":"https://api.github.com/repos/Microsoft/AL","labels_url":"https://api.github.com/repos/Microsoft/AL/issues/1553/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/AL/issues/1553/comments","events_url":"https://api.github.com/repos/Microsoft/AL/issues/1553/events","html_url":"https://github.com/Microsoft/AL/issues/1553","id":294167406,"number":1553,"title":"How do I use the new XmlDocument and related classes?","user":{"login":"DavidRoys","id":6288989,"avatar_url":"https://avatars3.githubusercontent.com/u/6288989?v=4","gravatar_id":"","url":"https://api.github.com/users/DavidRoys","html_url":"https://github.com/DavidRoys","followers_url":"https://api.github.com/users/DavidRoys/followers","following_url":"https://api.github.com/users/DavidRoys/following{/other_user}","gists_url":"https://api.github.com/users/DavidRoys/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidRoys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidRoys/subscriptions","organizations_url":"https://api.github.com/users/DavidRoys/orgs","repos_url":"https://api.github.com/users/DavidRoys/repos","events_url":"https://api.github.com/users/DavidRoys/events{/privacy}","received_events_url":"https://api.github.com/users/DavidRoys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-04T03:51:44Z","updated_at":"2018-02-06T09:12:48Z","closed_at":null,"author_association":"NONE","body":"I am trying to use the new XmlDocument class (and related classes) to update the value of a single node in an XML document but I cannot figure out how to do it.\r\n\r\nI have the XML Document as text (which is actually the ReportParameters from a report in NAV).\r\n\r\nI can use these lines to create my XmlDocument variable from the settings string.\r\n\r\n```\r\nSettingsXmlReadOptions.PreserveWhitespace := true;\r\nXmlDocument.ReadFrom(SettingsText, SettingsXmlReadOptions, SettingsXmlDoc);\r\n```\r\nI can find the node I'm interested in using: \r\n```\r\nSettingsXmlDoc.SelectSingleNode('/ReportParameters/Options/Field[@name='''+FieldName+''']/text()',OptionsFieldNode)\r\n```\r\n\r\nto select the text node or if I want to select the element that contains the text node I can use:\r\n\r\n```\r\nSettingsXmlDoc.SelectSingleNode('/ReportParameters/Options/Field[@name='''+FieldName+''']',OptionsFieldNode)\r\n```\r\n\r\nThis works OK and I can see I'm getting the correct node back, but how do I update the node to a new value and store it back into my variable? This is part 1 of my problem - I don't know how to set the value of my node. It would be nice if there was a InnerText property on my XML node so I could just set that. Can you please advise how I am supposed to do this without such a property?\r\n\r\nAlso, I am having a problem saving my XMLDocument back to a variable. If I try to use SettingsXmlDoc.WriteTo(MyTextVariable) I get a runtime error of:\r\n\r\nException of type 'Microsoft.Dynamics.Nav.Types.Exceptions.NavNCLArgumentException' was thrown.\r\n\r\nAm I doing something wrong here? Or does this new class just not work properly yet?"},"comment":{"url":"https://api.github.com/repos/Microsoft/AL/issues/comments/363358092","html_url":"https://github.com/Microsoft/AL/issues/1553#issuecomment-363358092","issue_url":"https://api.github.com/repos/Microsoft/AL/issues/1553","id":363358092,"user":{"login":"dennisfrostlander","id":16953692,"avatar_url":"https://avatars0.githubusercontent.com/u/16953692?v=4","gravatar_id":"","url":"https://api.github.com/users/dennisfrostlander","html_url":"https://github.com/dennisfrostlander","followers_url":"https://api.github.com/users/dennisfrostlander/followers","following_url":"https://api.github.com/users/dennisfrostlander/following{/other_user}","gists_url":"https://api.github.com/users/dennisfrostlander/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisfrostlander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisfrostlander/subscriptions","organizations_url":"https://api.github.com/users/dennisfrostlander/orgs","repos_url":"https://api.github.com/users/dennisfrostlander/repos","events_url":"https://api.github.com/users/dennisfrostlander/events{/privacy}","received_events_url":"https://api.github.com/users/dennisfrostlander/received_events","type":"User","site_admin":false},"created_at":"2018-02-06T09:12:48Z","updated_at":"2018-02-06T09:12:48Z","author_association":"CONTRIBUTOR","body":"Thanks for the repro. This is a bug caused by missing \"encoding\" attribute in the XML declaration."}}
{"actor":{"display_login":"dennisfrostlander"}}