{"id":15,"date":"2020-06-11T18:37:26","date_gmt":"2020-06-11T18:37:26","guid":{"rendered":"http:\/\/www.alipsa.se\/wordpress\/?p=15"},"modified":"2020-08-29T09:22:12","modified_gmt":"2020-08-29T09:22:12","slug":"xmlr-released-on-cran","status":"publish","type":"post","link":"https:\/\/www.alipsa.se\/wordpress\/2020\/06\/11\/xmlr-released-on-cran\/","title":{"rendered":"xmlr released on CRAN"},"content":{"rendered":"\n<p>Xmlr is a R packed providing an object oriented approach to XML management for R written in R&#8217;s Reference Classes. The project is located at <a href=\"https:\/\/github.com\/Alipsa\/xmlr\">github<\/a> and available for free under the MIT license. It was accepted by CRAN May 12 2020.<\/p>\n\n\n\n<p>To create the following xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\">&lt;table xmlns='http:\/\/www.w3.org\/TR\/html4\/'>\n    &lt;tr>\n        &lt;td>Apples&lt;\/td>\n        &lt;td>Bananas&lt;\/td>\n    &lt;\/tr>\n&lt;\/table><\/code><\/pre>\n\n\n\n<p>You could do something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\"> doc &lt;- Document$new()\n  root &lt;- Element$new(\"table\")\n  root$setAttribute(\"xmlns\", \"http:\/\/www.w3.org\/TR\/html4\/\")\n\n  root$addContent(\n    Element$new(\"tr\")\n      $addContent(Element$new(\"td\")$setText(\"Apples\"))\n      $addContent(Element$new(\"td\")$setText(\"Bananas\"))\n  )\n  doc$setRootElement(root)<\/code><\/pre>\n\n\n\n<p>Or you could do like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"c\" class=\"language-c\">doc2 &lt;- parse.xmlstring(\"\n&lt;table xmlns='http:\/\/www.w3.org\/TR\/html4\/'>\n    &lt;tr>\n        &lt;td>Apples&lt;\/td>\n        &lt;td>Bananas&lt;\/td>\n    &lt;\/tr>\n&lt;\/table>\")<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xmlr is a R packed providing an object oriented approach to XML management for R written in R&#8217;s Reference Classes. The project is located at github and available for free under the MIT license. It was accepted by CRAN May 12 2020. To create the following xml You could do something like this: Or you &hellip; <a href=\"https:\/\/www.alipsa.se\/wordpress\/2020\/06\/11\/xmlr-released-on-cran\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;xmlr released on CRAN&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-software-and-technology"],"_links":{"self":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/15"}],"collection":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":2,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":40,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/posts\/15\/revisions\/40"}],"wp:attachment":[{"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/media?parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/categories?post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alipsa.se\/wordpress\/wp-json\/wp\/v2\/tags?post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}