{"id":2945,"date":"2015-03-14T08:37:27","date_gmt":"2015-03-14T08:37:27","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=2945"},"modified":"2015-03-16T10:20:18","modified_gmt":"2015-03-16T10:20:18","slug":"changing-a-value-within-an-xml-document-using-f","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/changing-a-value-within-an-xml-document-using-f\/","title":{"rendered":"Changing a value within an XML document using F#"},"content":{"rendered":"<p>I needed to simulate some user interaction with our webservices in an automated manner. This post is specific to one small part of this requirement &#8211; here we&#8217;re going to simply take some XML and change a value within the data and return this altered data.<\/p>\n<p>The code is very simple but demonstrates how to deal with namespaces as well as using XmlDocument and XPath.<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/putridparrot\/0425fc9f8d88ee7ffac1.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/putridparrot\/0425fc9f8d88ee7ffac1\">Gist<\/a>.<\/noscript><\/div>\n<p><em>Note: I&#8217;m using XmlDocument here and XPath for simplicity but obviously this is not the most performant on large documents.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I needed to simulate some user interaction with our webservices in an automated manner. This post is specific to one small part of this requirement &#8211; here we&#8217;re going to simply take some XML and change a value within the data and return this altered data. The code is very simple but demonstrates how to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,70],"tags":[],"class_list":["post-2945","post","type-post","status-publish","format-standard","hentry","category-f","category-xml"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/2945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=2945"}],"version-history":[{"count":11,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/2945\/revisions"}],"predecessor-version":[{"id":2959,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/2945\/revisions\/2959"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=2945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=2945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=2945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}