{"id":19944716,"url":"https://github.com/rameshmf/java-xml-tutorial","last_synced_at":"2026-02-03T23:32:39.757Z","repository":{"id":99532983,"uuid":"151820599","full_name":"RameshMF/java-xml-tutorial","owner":"RameshMF","description":"Tutorial to parse or processing xml file in Java with different XML Parsers","archived":false,"fork":false,"pushed_at":"2018-10-09T02:30:25.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T10:51:02.268Z","etag":null,"topics":["dom-parser","jaxb","jdom","sax-parser","xml-document","xml-parser"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RameshMF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-06T08:38:51.000Z","updated_at":"2023-02-15T18:17:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"40fc24e8-4870-4fdf-8d62-31b75af23a7a","html_url":"https://github.com/RameshMF/java-xml-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RameshMF/java-xml-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RameshMF%2Fjava-xml-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RameshMF%2Fjava-xml-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RameshMF%2Fjava-xml-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RameshMF%2Fjava-xml-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RameshMF","download_url":"https://codeload.github.com/RameshMF/java-xml-tutorial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RameshMF%2Fjava-xml-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29061564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T23:14:54.203Z","status":"ssl_error","status_checked_at":"2026-02-03T23:14:50.873Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom-parser","jaxb","jdom","sax-parser","xml-document","xml-parser"],"created_at":"2024-11-13T00:22:31.964Z","updated_at":"2026-02-03T23:32:39.744Z","avatar_url":"https://github.com/RameshMF.png","language":null,"readme":"\u003cdiv dir=\"ltr\" style=\"text-align: left;\" trbidi=\"on\"\u003e\nJAVA provides excellent support and a rich set of libraries to parse, modify or inquire XML documents. This tutorial will explain various types of Java-based parsers with examples in a simple and intuitive way. We will also learn how to convert an object to/from XML using JAXB API in Java.\u003cbr\u003e\n\u003cbr\u003e\n\u003cdiv class=\"separator\" style=\"clear: both; text-align: center;\"\u003e\n\u003ca href=\"https://1.bp.blogspot.com/-BHKqU1lx7SE/W7mfG6xQ4mI/AAAAAAAAEL0/LwzWPVBdkPM6h0PoDRWlYU9yu2egdyuuQCLcBGAs/s1600/java-xml-tutorial.png\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"\u003e\u003cimg border=\"0\" data-original-height=\"201\" data-original-width=\"671\" src=\"https://1.bp.blogspot.com/-BHKqU1lx7SE/W7mfG6xQ4mI/AAAAAAAAEL0/LwzWPVBdkPM6h0PoDRWlYU9yu2egdyuuQCLcBGAs/s1600/java-xml-tutorial.png\"\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cbr\u003e\nIn Java JDK, two built-in XML parsers are available – DOM and SAX, both have their pros and cons. Here are few examples to show how to create, modify and read an XML file with Java DOM, SAX, JDOM.\u003cbr\u003e\n\u003ch2 style=\"text-align: left;\"\u003e\nDOM XML Parser\u003c/h2\u003e\nDOM Parser is the easiest Java XML parser to learn. DOM parser loads the XML file into memory and we can traverse it node by node to parse the XML. DOM Parser is good for small files but when file size increases it performs slow and consumes more memory.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-read-xml-file-in-java-dom-parser.html\" target=\"_blank\"\u003eHow to read XML file in Java - DOM Parser\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; This article shows you how to create XML file in Java using DOM XML Parser\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-create-xml-file-in-java-dom-parser.html\" target=\"_blank\"\u003eHow to Create XML File in Java\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;This article explains how to use DOM Parser to create and write Object data to an XML file.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-modify-or-update-xml-file-in-java-dom-parser.html\" target=\"_blank\"\u003eHow to Modify or Update XML File in Java\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;Check out, DOM Parser can be used to modify existing XML data as well.\u003cbr\u003e\n\u003ch2 style=\"text-align: left;\"\u003e\nSAX Parser\u003c/h2\u003e\n\u003cdiv\u003e\nSAX parser is work differently with DOM parser, it does not load any XML document into memory and create some object representation of the XML document. Instead, the SAX parser use callback function (org.xml.sax.helpers.DefaultHandler) to informs clients of the XML document structure.\u003c/div\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-read-xml-file-in-java-sax-parser.html\" target=\"_blank\"\u003eHow to Read XML File in Java- SAX Parser\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;Learn how to create our Callback Handler class to read XML file to list of Objects using SAX.\u003cbr\u003e\n\u003ch2 style=\"text-align: left;\"\u003e\nJDOM Parser\u003c/h2\u003e\n\u003cdiv\u003e\nJDOM provides a great Java XML parser API to read, edit and write XML documents easily. JDOM provides wrapper classes to chose your underlying implementation from SAX Parser, DOM Parser, STAX Event Parser, and STAX Stream Parser.\u003c/div\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-read-xml-file-in-java-jdom-parser.html\" target=\"_blank\"\u003eHow to Read XML File in Java- JDOM Parser\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;In this post, we will learn how to read XML file to Object using JDOM XML Parser.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-update-or-modify-xml-file-in-java-jdom-parser.html\" target=\"_blank\"\u003eHow to Update or Modify XML file in Java – JDOM Parser\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;In this article, we will learn how to update the existing XML file in Java using JDOM.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-create-xml-file-in-java-jdom-parser.html\" target=\"_blank\"\u003eHow to Create XML File in Java – JDOM Parser\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp;In this article, we will learn how to create XML file in Java using JDOM Parser.\u003cbr\u003e\n\u003ch2 style=\"text-align: left;\"\u003e\nJAXB\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdiv\u003e\nJava Architecture for XML Binding (JAXB) is a Java standard that defines how Java objects are converted from and to XML. It uses a standard set of mappings. JAXB defines an API for reading and writing Java objects to and from XML documents.\u003c/div\u003e\n\u003c/div\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-convert-java-object-to-xml-jaxb-marshalling.html\" target=\"_blank\"\u003eHow to Convert Java Object to XML - JAXB Marshalling\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In this article, we will learn how to convert a Java object to XML and write to an external file.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/how-to-convert-xml-to-java-object-jaxb-unmarshalling.html\" target=\"_blank\"\u003eHow to Convert XML to Java Object - JAXB Unmarshalling\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In this article, we will learn how to convert an XML to Java object using JAXB API.\u003cbr\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"http://www.javaguides.net/2018/10/jaxb-tutorial.html\" target=\"_blank\"\u003eJAXB Tutorial\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u0026nbsp; \u0026nbsp; \u0026nbsp; \u0026nbsp; In this tutorial, we will learn how to convert Java objects from and to XML using JAXB API.\u003cbr\u003e\n\u003ch2 style=\"text-align: left;\"\u003e\nReferences\u003c/h2\u003e\n\u003cul style=\"text-align: left;\"\u003e\n\u003cli\u003e\u003ca href=\"https://javaee.github.io/jaxb-v2/doc/user-guide/release-documentation.html\" target=\"_blank\"\u003eJAXB User Guide(Release Doc)\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://www.jdom.org/\" target=\"_blank\"\u003eJDOM Parser Doc\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://docs.oracle.com/javase/1.5.0/docs/api/org/w3c/dom/package-summary.html\" target=\"_blank\"\u003eDOM XML parser documentation\u003c/a\u003e\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/package-summary.html\" target=\"_blank\"\u003eSAX Parser Doc\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cblockquote class=\"tr_bq\"\u003e\nLearn all Java/J2EE Tutorial on \u003ca href=\"http://www.javaguides.net/p/top-java-tutorials.html\"\u003eAll Java Tutorials\u003c/a\u003e\u003c/blockquote\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameshmf%2Fjava-xml-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frameshmf%2Fjava-xml-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameshmf%2Fjava-xml-tutorial/lists"}