{"id":203,"date":"2021-02-22T22:05:04","date_gmt":"2021-02-22T20:05:04","guid":{"rendered":"https:\/\/www.juustila.com\/antti\/?p=203"},"modified":"2021-03-29T16:33:26","modified_gmt":"2021-03-29T13:33:26","slug":"stripping-xml","status":"publish","type":"post","link":"https:\/\/www.juustila.com\/antti\/2021\/02\/22\/stripping-xml\/","title":{"rendered":"Stripping XML"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"237\" src=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-1024x237.png\" alt=\"xmlstarlet ed -N d=&quot;http:\/\/www.w3.org\/2005\/Atom&quot; -N c=&quot;urn:oasis:names:tc:emergency:cap:1.2&quot; -d &quot;d:feed\/d:entry\/d:content\/c:alert\/c:info\/c:area\/c:polygon&quot; fmi-alerts.xml &gt; fmi-stripped.xml\n\" class=\"wp-image-204\" srcset=\"https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-1024x237.png 1024w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-300x69.png 300w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-768x178.png 768w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-1536x356.png 1536w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2-535x124.png 535w, https:\/\/www.juustila.com\/antti\/wp-content\/uploads\/2021\/02\/Stripping-large-elements-from-XML-file-2.png 1840w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I tried to make sense of a very, very large XML file with repeating elements of hundreds and hundreds of GPS coordinates, among other elements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Luckily I found <a href=\"http:\/\/xmlstar.sourceforge.net\">xmlstarlet<\/a>. Installation was easy with homebrew. I just specified the namespaces and the elements to remove. The original 20Mb XML file was stripped to mere 140kb. Much easier to read!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I tried to make sense of a very, very large XML file with repeating elements of hundreds and hundreds of GPS coordinates, among other elements. Luckily I found xmlstarlet. Installation was easy with homebrew. I just specified the namespaces and the elements to remove. The original 20Mb XML file was stripped to mere 140kb. Much &hellip; <a href=\"https:\/\/www.juustila.com\/antti\/2021\/02\/22\/stripping-xml\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Stripping XML&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[2],"tags":[64,65],"class_list":["post-203","post","type-post","status-publish","format-standard","hentry","category-coding","tag-xml","tag-xmlstarlet"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/comments?post=203"}],"version-history":[{"count":2,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/203\/revisions"}],"predecessor-version":[{"id":216,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/posts\/203\/revisions\/216"}],"wp:attachment":[{"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/media?parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/categories?post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.juustila.com\/antti\/wp-json\/wp\/v2\/tags?post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}