{"id":20,"date":"2006-11-27T23:37:11","date_gmt":"2006-11-27T23:37:11","guid":{"rendered":"http:\/\/markandkelley.com\/mark\/?p=20"},"modified":"2012-01-30T02:37:34","modified_gmt":"2012-01-30T02:37:34","slug":"xml2object-jsxml-object-converter","status":"publish","type":"post","link":"https:\/\/www.hickendesign.com\/site\/2006\/11\/xml2object-jsxml-object-converter\/","title":{"rendered":"XML2Object JSXML object converter"},"content":{"rendered":"<p>I found an actionscript version of this script quite some time ago. I&#8217;ve used it heavily and had need of the same thing in Javascript. So, here&#8217;s the JS version of it.<\/p>\n<p><a id=\"p23\" href=\"http:\/\/www.hickendesign.com\/site\/wp-content\/uploads\/2006\/11\/ajaxplusxml2object.zip\">XML2Object Example<\/a><\/p>\n<p>Essentially this script allows you to pass an XMLNode object and it will return a Javascript tree&#8217;d object for you. If your xml document looks like this&#8230;<br \/>\n<code><\/code><\/p>\n<pre>&lt;notes&gt;\n&nbsp;&nbsp;&lt;note id=\"note 1\"&gt;This is the text for note 1&lt;\/note&gt;\n&nbsp;&nbsp;&lt;note id=\"note 2\"&gt;This is the text for note 2&lt;\/note&gt;\n&lt;\/notes&gt;<\/pre>\n<p>Then your JS object would give you access like this&#8230;<br \/>\nxml.notes.note[0].value<br \/>\nor<br \/>\nxml.notes.note[&#8216;note 1&#8217;].value<\/p>\n<p>It also gives you access to the original xmlNode object from which it was derived&#8230;<br \/>\nxml.notes.note[0].node.nodeValue<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I found an actionscript version of this script quite some time ago. I&#8217;ve used it heavily and had need of the same thing in Javascript. So, here&#8217;s the JS version of it. XML2Object Example Essentially this script allows you to pass an XMLNode object and it will return a Javascript tree&#8217;d object for you. If &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hickendesign.com\/site\/2006\/11\/xml2object-jsxml-object-converter\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;XML2Object JSXML object converter&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-general-posts"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":1,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"predecessor-version":[{"id":922,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/20\/revisions\/922"}],"wp:attachment":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}