{"id":2120,"date":"2011-05-13T15:58:00","date_gmt":"2011-05-13T10:28:00","guid":{"rendered":"http:\/\/JitendraZaa.com\/blog\/?p=2120"},"modified":"2011-05-13T15:58:00","modified_gmt":"2011-05-13T10:28:00","slug":"validate-xml-schema-using-dom-parser-and-sax-parser-in-java-using-swing","status":"publish","type":"post","link":"https:\/\/www.jitendrazaa.com\/blog\/java\/validate-xml-schema-using-dom-parser-and-sax-parser-in-java-using-swing\/","title":{"rendered":"Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing"},"content":{"rendered":"<p>In this article, i am going to use the Swing for the UI purpose and for the XML validation against its schema i will use DOM parser as well as SAX Parser. <a title=\"How Dom Parser and SAX Parser works\" href=\"https:\/\/jitendrazaa.com\/blog\/java\/introduction-to-jaxp\/\" target=\"_blank\">previously we have already seen that how these parsers works in detail<\/a>.<\/p>\n<p>Application output will look like below snap:<\/p>\n<figure id=\"attachment_2125\" aria-describedby=\"caption-attachment-2125\" style=\"width: 492px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Input-Screen-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2125 \" title=\"Input Screen - XML Schema Validation in JAVA Using DOM and SAX Parser\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Input-Screen-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?resize=492%2C391&#038;ssl=1\" alt=\"Input Screen - XML Schema Validation in JAVA Using DOM and SAX Parser\" width=\"492\" height=\"391\" \/><\/a><figcaption id=\"caption-attachment-2125\" class=\"wp-caption-text\">Input Screen - XML Schema Validation in JAVA Using DOM and SAX Parser<\/figcaption><\/figure>\n<p><strong><!--more-->How to validate using DOM Parser :<\/strong><\/p>\n<ul>\n<li>Create instance of &#8220;<strong>DocumentBuilderFactory<\/strong>&#8220;.<\/li>\n<li>Set validation true.<\/li>\n<li>Set two attributes for schema language and schema source in factory instance.<\/li>\n<li>Create instance of &#8220;<strong>DocumentBuilder<\/strong>&#8221; from factory and parse.<\/li>\n<li>Check validateUsingDOM() method in below code.<\/li>\n<\/ul>\n<p><strong>How to validate using SAX Parser:<\/strong><\/p>\n<ul>\n<li>Create instance of &#8220;<strong>SAXParserFactory<\/strong>&#8220;.<\/li>\n<li>Set validation true.<\/li>\n<li>Create instance of &#8220;<strong>SAXParser<\/strong>&#8221; from factory object.<\/li>\n<li>Set two property for schema language and schema source in parser instance and parse.<\/li>\n<li>Check\u00a0validateUsingSAX() method in below code.<\/li>\n<\/ul>\n<p>Complete code:<\/p>\n<pre class=\"brush: java; highlight: [140,189]; title: ; notranslate\" title=\"\">\npackage com.g2.XML;\n\nimport java.awt.Color;\nimport java.awt.EventQueue;\nimport java.awt.Font;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.io.StringWriter;\nimport java.io.Writer;\n\nimport javax.swing.AbstractAction;\nimport javax.swing.Action;\nimport javax.swing.JButton;\nimport javax.swing.JFileChooser;\nimport javax.swing.JFrame;\nimport javax.swing.JScrollPane;\nimport javax.swing.JTextArea;\nimport javax.swing.JTextField;\nimport javax.xml.parsers.DocumentBuilder;\nimport javax.xml.parsers.DocumentBuilderFactory;\nimport javax.xml.parsers.ParserConfigurationException;\nimport javax.xml.parsers.SAXParser;\nimport javax.xml.parsers.SAXParserFactory;\n\nimport org.xml.sax.SAXException;\nimport org.xml.sax.helpers.DefaultHandler;\n\npublic class DOMXMLSchemaValidator {\n\n\tprivate JFrame frame;\n\tprivate JTextField txtXSDName;\n\tprivate final Action action = new SwingAction();\n\tprivate JFileChooser fc = new JFileChooser();\n\tJTextArea txtResult = new JTextArea();\n\n\tprivate JTextField txtXMLName;\n\tprivate JButton btnValidateUsingDom;\n\tprivate JButton btnValidateUsingSax;\n\tprivate JButton btnDisplayActualError;\n\tprivate String errorMsg;\n\tprivate JScrollPane scrollPane;\n\n\t\/**\n\t * Launch the application.\n\t *\/\n\tpublic static void main(String&#x5B;] args) {\n\t\tEventQueue.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tDOMXMLSchemaValidator window = new DOMXMLSchemaValidator();\n\t\t\t\t\twindow.frame.setVisible(true);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\t\/**\n\t * Create the application.\n\t *\/\n\tpublic DOMXMLSchemaValidator() {\n\t\tinitialize();\n\t}\n\n\t\/**\n\t * Initialize the contents of the frame.\n\t *\/\n\tprivate void initialize() {\n\t\tApplicationActions btnActions = this.new ApplicationActions();\n\n\t\tframe = new JFrame(&quot;XML Schema Validator using DOM Parser&quot;);\n\t\tframe.getContentPane().setBackground( Color.LIGHT_GRAY);\n\t\tframe.setBounds(100, 100, 492, 300);\n\t\tframe.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE);\n\t\tframe.getContentPane().setLayout(null);\n\n\t\tJButton btnSelectXsdFile = new JButton(&quot;Select XSD File&quot;);\n\t\tbtnSelectXsdFile.setAction(action);\n\t\tbtnSelectXsdFile.setBounds(327, 11, 127, 23);\n\t\tframe.getContentPane().add(btnSelectXsdFile);\n\n\t\ttxtXSDName = new JTextField();\n\t\ttxtXSDName.setBounds(10, 12, 298, 23);\n\t\tframe.getContentPane().add(txtXSDName);\n\t\ttxtXSDName.setColumns(10);\n\n\t\ttxtXMLName = new JTextField();\n\t\ttxtXMLName.setColumns(10);\n\t\ttxtXMLName.setBounds(10, 46, 298, 23);\n\t\tframe.getContentPane().add(txtXMLName);\n\n\t\tJButton btnSelectXmlFile = new JButton(&quot;Select XML File&quot;);\n\t\tbtnSelectXmlFile.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\ttxtResult.setBackground(Color.ORANGE);\n\t\t\t\tint returnVal = fc.showOpenDialog(frame);\n\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tFile file = fc.getSelectedFile();\n\t\t\t\t\ttxtXMLName.setText(file.getPath());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\tbtnSelectXmlFile.setBounds(327, 45, 127, 23);\n\t\tbtnSelectXmlFile.addActionListener(btnActions);\n\t\tframe.getContentPane().add(btnSelectXmlFile);\n\n\t\tbtnValidateUsingDom = new JButton(&quot;Validate Using DOM&quot;);\n\t\tbtnValidateUsingDom.setBounds(50, 93, 172, 23);\n\t\tbtnValidateUsingDom.addActionListener(new ApplicationActions());\n\t\tframe.getContentPane().add(btnValidateUsingDom);\n\n\t\tbtnValidateUsingSax = new JButton(&quot;Validate Using SAX&quot;);\n\t\tbtnValidateUsingSax.setBounds(262, 93, 164, 23);\n\t\tframe.getContentPane().add(btnValidateUsingSax);\n\t\tbtnValidateUsingSax.addActionListener(new ApplicationActions());\n\n\t\tscrollPane = new JScrollPane();\n\t\tscrollPane.setBounds(10, 161, 464, 112);\n\t\tframe.getContentPane().add(scrollPane);\n\t\tscrollPane.setViewportView(txtResult);\n\n\t\ttxtResult.setFont(new Font(&quot;Monospaced&quot;, Font.PLAIN, 13));\n\t\ttxtResult.setBackground(Color.ORANGE);\n\n\t\tbtnDisplayActualError = new JButton(&quot;Display Actual Error&quot;);\n\t\tbtnDisplayActualError.setBounds(148, 127, 154, 23);\n\t\tframe.getContentPane().add(btnDisplayActualError);\n\t\tbtnDisplayActualError.setVisible(false);\n\t\tbtnDisplayActualError.addActionListener(new ApplicationActions());\n\n\t}\n\n\tprivate void validateUsingDOM() {\n\t\terrorMsg = &quot;&quot;;\n\t\tDocumentBuilderFactory DF = DocumentBuilderFactory.newInstance();\n\t\tDF.setValidating(true);\n\n\t\tDF.setAttribute(\n\t\t\t\t&quot;http:\/\/java.sun.com\/xml\/jaxp\/ properties\/schemaLanguage&quot;,\n\t\t\t\t&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;);\n\n\t\tDF.setAttribute(&quot;http:\/\/java.sun.com\/xml\/jaxp\/ properties\/schemaSource&quot;,\n\t\t\t\ttxtXSDName.getText());\n\t\ttry {\n\t\t\tDocumentBuilder DB = DF.newDocumentBuilder();\n\t\t\tDB.parse(txtXMLName.getText());\n\t\t\tstyleTextBox(false, null);\n\t\t} catch (ParserConfigurationException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (SAXException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (IOException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (Exception e) {\n\t\t\tstyleTextBox(true, e);\n\t\t}\n\n\t}\n\n\tprivate void styleTextBox(boolean isError, Throwable t) {\n\t\tif (isError) {\n\t\t\tbtnDisplayActualError.setVisible(true);\n\t\t\ttxtResult.setBackground(Color.RED);\n\t\t\ttxtResult\n\t\t\t\t\t.setText(&quot;Document is not validated or Some error occured&quot;);\n\t\t\tif (t != null) {\n\t\t\t\tgetStackTrace(t);\n\t\t\t}\n\t\t} else {\n\t\t\ttxtResult.setBackground(Color.GREEN);\n\t\t\ttxtResult.setText(&quot;Validation Success...&quot;);\n\t\t}\n\t}\n\n\tpublic void getStackTrace(Throwable aThrowable) {\n\t\tWriter result = new StringWriter();\n\t\tPrintWriter printWriter = new PrintWriter(result);\n\t\taThrowable.printStackTrace(printWriter);\n\t\terrorMsg = result.toString();\n\t}\n\n\tprivate void validateUsingSAX() {\n\t\tSAXParserFactory SF = SAXParserFactory.newInstance();\n\t\tSF.setValidating(true);\n\n\t\tSAXParser SP;\n\t\ttry {\n\t\t\tSP = SF.newSAXParser();\n\t\t\tSP.setProperty(\n\t\t\t\t\t&quot;http:\/\/java.sun.com\/xml\/jaxp\/ properties\/schemaLanguage&quot;,\n\t\t\t\t\t&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;);\n\t\t\tSP.setProperty(\n\t\t\t\t\t&quot;http:\/\/java.sun.com\/xml\/jaxp\/ properties\/schemaSource&quot;,\n\t\t\t\t\ttxtXSDName.getText());\n\t\t\tSP.parse(new File(txtXMLName.getText()), new DefaultHandler());\n\t\t\tstyleTextBox(false, null);\n\t\t} catch (ParserConfigurationException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (SAXException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (IOException e) {\n\t\t\tstyleTextBox(true, e);\n\t\t} catch (Exception e) {\n\t\t\tstyleTextBox(true, e);\n\t\t}\n\t}\n\n\tprivate class SwingAction extends AbstractAction {\n\t\tpublic SwingAction() {\n\t\t\tputValue(NAME, &quot;Select XSD File&quot;);\n\t\t\tputValue(SHORT_DESCRIPTION, &quot;Select XML schema file present on local disc&quot;);\n\t\t}\n\n\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\ttxtResult.setBackground(Color.ORANGE);\n\t\t\tif (e.getActionCommand().equals(&quot;Select XSD File&quot;)) {\n\t\t\t\tint returnVal = fc.showOpenDialog(frame);\n\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\t\t\tFile file = fc.getSelectedFile();\n\t\t\t\t\ttxtXSDName.setText(file.getPath());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate class ApplicationActions implements ActionListener {\n\n\t\t@Override\n\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\tif (evt.getActionCommand().equals(&quot;Validate Using DOM&quot;)) {\n\t\t\t\tif (validateControls()) {\n\t\t\t\t\tvalidateUsingDOM();\n\t\t\t\t}\n\t\t\t} else if (evt.getActionCommand().equals(&quot;Display Actual Error&quot;)) {\n\t\t\t\ttxtResult.setText(errorMsg);\n\t\t\t} else if (evt.getActionCommand().equals(&quot;Validate Using SAX&quot;)) {\n\t\t\t\tif (validateControls())\n\t\t\t\t\tvalidateUsingSAX();\n\t\t\t}\n\n\t\t}\n\n\t\tprivate boolean validateControls() {\n\t\t\tboolean retVal = true;\n\t\t\tif (txtXMLName.getText().trim().equals(&quot;&quot;)) {\n\t\t\t\ttxtXMLName.setBackground(Color.RED);\n\t\t\t\ttxtXMLName.setText(&quot;Required field&quot;);\n\t\t\t\tretVal = false;\n\t\t\t}\n\t\t\tif (txtXSDName.getText().trim().equals(&quot;&quot;)) {\n\t\t\t\ttxtXSDName.setBackground(Color.RED);\n\t\t\t\ttxtXSDName.setText(&quot;Required field&quot;);\n\t\t\t\tretVal = false;\n\t\t\t}\n\t\t\treturn retVal;\n\t\t}\n\n\t}\n}\n<\/pre>\n<p><strong>Output:<\/strong><br \/>\n1. Validation succeeded<\/p>\n<figure id=\"attachment_2126\" aria-describedby=\"caption-attachment-2126\" style=\"width: 491px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Validation-Success-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2126\" title=\"Validation Success - XML Schema Validation in JAVA Using DOM and SAX Parser\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Validation-Success-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?resize=491%2C299&#038;ssl=1\" alt=\"Validation Success - XML Schema Validation in JAVA Using DOM and SAX Parser\" width=\"491\" height=\"299\" \/><\/a><figcaption id=\"caption-attachment-2126\" class=\"wp-caption-text\">Validation Success - XML Schema Validation in JAVA Using DOM and SAX Parser<\/figcaption><\/figure>\n<p>2. Validation failed<\/p>\n<figure id=\"attachment_2127\" aria-describedby=\"caption-attachment-2127\" style=\"width: 493px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Validation-Fail-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2127\" title=\"Validation Fail - XML Schema Validation in JAVA Using DOM and SAX Parser\" src=\"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/05\/Validation-Fail-XML-Schema-Validation-in-JAVA-Using-DOM-and-SAX-Parser.png?resize=493%2C299&#038;ssl=1\" alt=\"Validation Fail - XML Schema Validation in JAVA Using DOM and SAX Parser\" width=\"493\" height=\"299\" \/><\/a><figcaption id=\"caption-attachment-2127\" class=\"wp-caption-text\">Validation Fail - XML Schema Validation in JAVA Using DOM and SAX Parser<\/figcaption><\/figure>\n<p><strong>Sample XSD (Schema) document:<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;xsd:schema xmlns:xsd=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;\n  &lt;xsd:element name=&quot;cricket&quot; type=&quot;CricketType&quot; \/&gt;\n\n  &lt;xsd:complexType name=&quot;CricketType&quot;&gt;\n    &lt;xsd:sequence&gt;\n      &lt;xsd:element name=&quot;team&quot; type=&quot;TeamType&quot; maxOccurs=&quot;unbounded&quot; \/&gt;\n    &lt;\/xsd:sequence&gt;\n  &lt;\/xsd:complexType&gt;\n\n  &lt;xsd:complexType name=&quot;TeamType&quot;&gt;\n    &lt;xsd:sequence&gt;\n      &lt;xsd:element name=&quot;player&quot; type=&quot;PlayerType&quot; maxOccurs=&quot;16&quot; minOccurs=&quot;1&quot; \/&gt;\n    &lt;\/xsd:sequence&gt;\n    &lt;xsd:attribute name=&quot;country&quot; type=&quot;xsd:string&quot; use=&quot;required&quot; \/&gt;\n  &lt;\/xsd:complexType&gt;\n\n  &lt;xsd:complexType name=&quot;PlayerType&quot;&gt;\n    &lt;xsd:sequence&gt;\n      &lt;xsd:element name=&quot;player-name&quot; type=&quot;xsd:string&quot; \/&gt;\n      &lt;xsd:element name=&quot;total-runs&quot; type=&quot;xsd:positiveInteger&quot; \/&gt;\n      &lt;xsd:element name=&quot;no-of-100s&quot; type=&quot;xsd:positiveInteger&quot; \/&gt;\n      &lt;xsd:element name=&quot;no-of-50s&quot; type=&quot;xsd:positiveInteger&quot; \/&gt;\n    &lt;\/xsd:sequence&gt;\n  &lt;\/xsd:complexType&gt;\n\n&lt;\/xsd:schema&gt;\n<\/pre>\n<p><strong>Sample XML document:<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\n\n&lt;cricket xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;&gt;\n  &lt;team country=&quot;India&quot;&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Player1&lt;\/player-name&gt;\n      &lt;total-runs&gt;10000&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;30&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;70&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Player2&lt;\/player-name&gt;\n      &lt;total-runs&gt;1000&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;1&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;3&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Player3&lt;\/player-name&gt;\n      &lt;total-runs&gt;6443&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;12&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;23&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n  &lt;\/Team&gt;\n\n  &lt;team country=&quot;Australia&quot;&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Aussie Player1&lt;\/player-name&gt;\n      &lt;total-runs&gt;10000&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;30&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;70&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Aussie  Player2&lt;\/player-name&gt;\n      &lt;total-runs&gt;1000&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;1&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;3&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n    &lt;player&gt;\n      &lt;player-name&gt;Aussie Player3&lt;\/player-name&gt;\n      &lt;total-runs&gt;6443&lt;\/total-runs&gt;\n      &lt;no-of-100s&gt;12&lt;\/no-of-100s&gt;\n      &lt;no-of-50s&gt;23&lt;\/no-of-50s&gt;\n    &lt;\/player&gt;\n  &lt;\/team&gt;\n&lt;\/cricket&gt;\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Validate XML Schema Using DOM Parser and SAX Parser in JAVA Using Swing<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"jz_research_post":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[3],"tags":[227],"class_list":["post-2120","post","type-post","status-publish","format-standard","hentry","category-java","tag-xml"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1774,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/difference-between-sax-and-dom-parsers\/","url_meta":{"origin":2120,"position":0},"title":"Difference between SAX and DOM Parsers","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"What is the difference between SAX And DOM Parsers","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1742,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/introduction-to-jaxp\/","url_meta":{"origin":2120,"position":1},"title":"Introduction to JAXP and Difference between JAXP and JAXB","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"Introduction to JAXP (JAVA API for XML Processing), SAX (Simple API for XML Parsing),Extensible Style sheet language transformation (XSLT)","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"XML Processing using DOM in JAXP","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/03\/XML-Processing-using-DOM-in-JAXP.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1764,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/read-xml-file-using-sax-parser-in-java\/","url_meta":{"origin":2120,"position":2},"title":"Read XML File using SAX Parser in JAVA","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"Example of Reading XML File using SAX Parser in JAVA","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"SAX Parser","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/03\/SAX-Parser.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1767,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/xml-tree-viewer-using-sax-parser-in-java-with-jtreejfilechooser-component-of-swing\/","url_meta":{"origin":2120,"position":3},"title":"XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"XML Tree Viewer using SAX Parser in JAVA with Jtree,JFileChooser component of Swing, How to refresh Jtree when content changes , Expand or collapse JTree","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"XML Tree Viewer using SAX Parser in JAVA","src":"https:\/\/i0.wp.com\/jitendrazaa.com\/blog\/wp-content\/uploads\/2011\/03\/XML-Tree-Viewer-using-SAX-Parser-in-JAVA.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1756,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/searching-xml-file-using-dom-parser-of-jaxp\/","url_meta":{"origin":2120,"position":4},"title":"Searching XML File using DOM Parser of JAXP","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"Example of Searching XML File using DOM Parser of JAXP","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1753,"url":"https:\/\/www.jitendrazaa.com\/blog\/java\/traverse-xml-file-using-dom-parser-of-jaxp\/","url_meta":{"origin":2120,"position":5},"title":"Traverse XML file using DOM Parser of JAXP","author":"Jitendra","date":"March 22, 2011","format":false,"excerpt":"Example of Traverse XML file using DOM Parser of JAXP","rel":"","context":"In &quot;JAVA&quot;","block_context":{"text":"JAVA","link":"https:\/\/www.jitendrazaa.com\/blog\/category\/java\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/comments?post=2120"}],"version-history":[{"count":0,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/posts\/2120\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/media?parent=2120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/categories?post=2120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jitendrazaa.com\/blog\/wp-json\/wp\/v2\/tags?post=2120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}