{"id":110261,"date":"2002-05-31T16:00:00","date_gmt":"2002-05-31T08:00:00","guid":{"rendered":"http:\/\/itteacheritfreelance.hk\/test\/wordpress\/?guid=ea831894ed2ffad5a1518b16245f328a"},"modified":"2002-05-31T16:00:00","modified_gmt":"2002-05-31T08:00:00","slug":"java-tip-128-create-a-quick-and-dirty-xml-parser-2","status":"publish","type":"post","link":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/2002\/05\/31\/java-tip-128-create-a-quick-and-dirty-xml-parser-2\/","title":{"rendered":"Java Tip 128: Create a quick-and-dirty XML parser"},"content":{"rendered":"<article>\n<section class=\"page\">\n<p>XML is a popular data format for several reasons: it is human readable, self-describing, and portable. Unfortunately, many Java-based XML parsers are very large; for example, Sun Microsystems&#8217; <code>jaxp.jar<\/code> and <code>parser.jar<\/code> libraries are 1.4 MB each. If you are running with limited memory (for example, in a J2ME (Java 2 Platform, Micro Edition) environment), or bandwidth is at a premium (for example, in an applet), using those large parsers might not be a viable solution.<\/p>\n<p>Those libraries&#8217; large size is partly due to having a lot of functionality\u2014perhaps more than you require. They validate XML DTDs (document type definitions), possibly schemas, and more. However, you might already know that your application will receive valid XML. Also, you might already decide that you want just the UTF-8 character set. Therefore, you really want event-based processing of XML elements and translation of standard XML entities\u2014you want a nonvalidating parser.<\/p>\n<p class=\"jumpTag\"><a href=\"https:\/\/www.javaworld.com\/article\/2077493\/java-tip-128--create-a-quick-and-dirty-xml-parser.html#jump\">To read this article in full, please click here<\/a><\/p>\n<\/section>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<article>\n<section>\n<p>XML is a popular data format for several reasons: it is human readable, self-describing, and portable. Unfortunately, many Java-based XML parsers are very large; for example, Sun Microsystems&#8217; <code>jaxp.jar<\/code> and <code>parser.jar<\/code> libraries are 1.4 MB each. If you are running with limited memory (for example, in a J2ME (Java 2 Platform, Micro Edition) environment), or bandwidth is at a premium (for example, in an applet), using those large parsers might not be a viable solution.<\/p>\n<p>Those libraries&#8217; large size is partly due to having a lot of functionality&mdash;perhaps more than you require. They validate XML DTDs (document type definitions), possibly schemas, and more. However, you might already know that your application will receive valid XML. Also, you might already decide that you want just the UTF-8 character set. Therefore, you really want event-based processing of XML elements and translation of standard XML entities&mdash;you want a nonvalidating parser.<\/p>\n<p><a href=\"https:\/\/www.javaworld.com\/article\/2077493\/java-tip-128--create-a-quick-and-dirty-xml-parser.html#jump\">To read this article in full, please click here<\/a><\/p>\n<\/section>\n<\/article>\n<p> <a href=\"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/2002\/05\/31\/java-tip-128-create-a-quick-and-dirty-xml-parser-2\/\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":201,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"slim_seo":[],"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[2,315,7,240],"tags":[398,402,397,414,413,410,409,407,408,406,399,400,394,375,558,556,557,560,559,555,561,566,553,554,565,563,564,562,183,567,568,10,401,396,403,412,411,395,405,404],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7prtj-sGp","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/110261"}],"collection":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/users\/201"}],"replies":[{"embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/comments?post=110261"}],"version-history":[{"count":2,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/110261\/revisions"}],"predecessor-version":[{"id":174434,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/posts\/110261\/revisions\/174434"}],"wp:attachment":[{"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/media?parent=110261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/categories?post=110261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itteacheritfreelance.hk\/test\/wordpress\/wp-json\/wp\/v2\/tags?post=110261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}