{"id":125,"date":"2008-12-16T00:00:20","date_gmt":"2008-12-16T07:00:20","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=361"},"modified":"2008-12-16T00:00:20","modified_gmt":"2008-12-16T07:00:20","slug":"xml-node-parents","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=125","title":{"rendered":"XML Node Parents"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nfunction numParents(e:XML):int {\r\n\tvar num:int = 0;\r\n\twhile (e.parent()!= null) {\r\n\t\tnum++;\r\n\t\te = e.parent();\r\n\t}\r\n\treturn num;\r\n}\r\n<\/pre>\n<p>Sometimes when reading through XML it&#8217;s helpful to know how many parents a given node has. This function will do that. I recently used this function in an accordion widget.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>function numParents(e:XML):int { var num:int = 0; while (e.parent()!= null) { num++; e = e.parent(); } return num; } Sometimes when reading through XML it&#8217;s helpful to know how many parents a given node has. This function will do that. I recently used this function in an accordion widget.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[3,4],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-xml","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=125"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/125\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}