{"id":1001394,"date":"2008-09-16T08:49:37","date_gmt":"2008-09-16T13:49:37","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/?p=1001394"},"modified":"2008-09-16T08:49:37","modified_gmt":"2008-09-16T13:49:37","slug":"android-xml-weirdness","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/xml\/2008\/09\/16\/android-xml-weirdness\/","title":{"rendered":"Android XML Weirdness"},"content":{"rendered":"<p>Here&#8217;s something weird I noticed while fooling around with the <a href=\"http:\/\/code.google.com\/android\/\">Android SDK<\/a>:<\/p>\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n&lt;TextView xmlns:a=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    a:layout_width=\"fill_parent\" \r\n    a:layout_height=\"wrap_content\" \r\n    a:text=\"Hello World\"\r\n    \/>\r\n<\/code><\/pre>\n<p>If the weirdness doesn&#8217;t strike you, look twice.<br \/>\n<!--more--><\/p>\n<p>The attributes are in the Android namespace but the elements are in no namespace at all. This is exactly the reverse of the usual pattern. Can anyone explain this? I&#8217;m not sure it&#8217;s wrong, but it&#8217;s certainly strange, and violates the principle of least surprise. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s something weird I noticed while fooling around with the Android SDK: &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?> &lt;TextView xmlns:a=&#8221;http:\/\/schemas.android.com\/apk\/res\/android&#8221; a:layout_width=&#8221;fill_parent&#8221; a:layout_height=&#8221;wrap_content&#8221; a:text=&#8221;Hello World&#8221; \/> If the weirdness doesn&#8217;t strike you, look twice.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,13],"tags":[],"class_list":["post-1001394","post","type-post","status-publish","format-standard","hentry","category-mobile","category-xml"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1001394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1001394"}],"version-history":[{"count":2,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1001394\/revisions"}],"predecessor-version":[{"id":1001404,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1001394\/revisions\/1001404"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1001394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1001394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1001394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}