title
XML Parsers | Parsing XML using DOM and SAX Parsers | Edureka

description
( Java Training - https://www.edureka.co/java-j2ee-training-course ) A parser is a piece of program that takes a physical representation of some data and converts it into an in-memory form for the program as a whole to use. Parsers are used everywhere in software. An XML Parser is a parser that is designed to read XML and create a way for programs to use XML. There are different types, and each has its advantages. Unless a program simply and blindly copies the whole XML file as a unit, every program must implement or call on an XML parser. This video gives a brief insight of XML Parsers.Video also explains the difference between DOM and SAX Parser and Parsing XML using DOM and SAX Parser. Here are the related blogs: http://www.edureka.co/blog/understanding-java-hashmaps/?utm_source=youtube&utm_medium=referral&utm_campaign=xmlparse http://www.edureka.co/blog/methods-and-method-overloading-in-java/?utm_source=youtube&utm_medium=referral&utm_campaign=xmlparse http://www.edureka.co/blog/dynamic-data-allocation-in-java/?utm_source=youtube&utm_medium=referral&utm_campaign=xmlparse Edureka is a New Age e-learning platform that provides Instructor-Led Live, Online classes for learners who would prefer a hassle free and self paced learning environment, accessible from any part of the world. The topics related to 'XML Parsers' have extensively been covered in our 'JAVA/J2EE & SOA' course. For more information, please write back to us at sales@edureka.co or call us at IND: 9606058406 / US: 18338555775 (toll free).

detail
{'title': 'XML Parsers | Parsing XML using DOM and SAX Parsers | Edureka', 'heatmap': [{'end': 311.453, 'start': 285.358, 'weight': 0.793}, {'end': 440.052, 'start': 409.988, 'weight': 0.755}, {'end': 1706.908, 'start': 1652.207, 'weight': 0.704}, {'end': 2070.418, 'start': 1964.906, 'weight': 0.754}], 'summary': 'Discusses the differences between dom and sax xml parsers, emphasizing dom as tree-based and slower, and sax as event-based and used for parsing large xml files. it also introduces the factory pattern in design patterns, covers creating and writing xml documents in java, dom parsing, javascript iteration, xml parsing using dom and sax, and sacs parser for xml parsing including space removal and practical implementation.', 'chapters': [{'end': 695.582, 'segs': [{'end': 93.535, 'src': 'embed', 'start': 47.756, 'weight': 0, 'content': [{'end': 49.057, 'text': 'There are two kinds of parsers.', 'start': 47.756, 'duration': 1.301}, {'end': 54.018, 'text': 'One is DOM, which is Document Object Model.', 'start': 49.277, 'duration': 4.741}, {'end': 64.421, 'text': 'Another one is SACS, Simple API for XML.', 'start': 58.339, 'duration': 6.082}, {'end': 76.844, 'text': 'Now, if you look at DOM, DOM is tree-based.', 'start': 73.041, 'duration': 3.803}, {'end': 85.65, 'text': 'Like XML, like you know, you have a root element, you have branches, you have leaves, like that.', 'start': 78.165, 'duration': 7.485}, {'end': 91.634, 'text': "Simple API for SACS, XML is on, it's based on event-based.", 'start': 86.751, 'duration': 4.883}, {'end': 93.535, 'text': 'That is like.', 'start': 92.254, 'duration': 1.281}], 'summary': 'Two types of parsers: dom (document object model) is tree-based, while sacs (simple api for xml) is event-based.', 'duration': 45.779, 'max_score': 47.756, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU47756.jpg'}, {'end': 247.31, 'src': 'embed', 'start': 183.079, 'weight': 1, 'content': [{'end': 208.857, 'text': 'If 500 MB of XML is there, right? Okay, now SACS is used when big XML files needs to be parsed.', 'start': 183.079, 'duration': 25.778}, {'end': 230.869, 'text': 'Okay, now DOM is tree-based parser, SACS is event-based parser.', 'start': 210.718, 'duration': 20.151}, {'end': 241.075, 'text': 'So, whenever data you are reading, it reads, it goes to a text file, the function corresponding method it calls.', 'start': 232.648, 'duration': 8.427}, {'end': 247.31, 'text': 'Okay, DOM is slow when compared to SACS, and SACS is faster than DOM right?', 'start': 241.969, 'duration': 5.341}], 'summary': 'Sacs is faster than dom for parsing big xml files, with 500 mb as an example.', 'duration': 64.231, 'max_score': 183.079, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU183079.jpg'}, {'end': 311.453, 'src': 'heatmap', 'start': 278.373, 'weight': 2, 'content': [{'end': 283.257, 'text': 'We can read only from SACS, but using DOM we can write also.', 'start': 278.373, 'duration': 4.884}, {'end': 293.645, 'text': 'Why DOM and SACS? From the program, if the XML file needs to be read, then developer has to write their own code to pass the XML file.', 'start': 285.358, 'duration': 8.287}, {'end': 294.585, 'text': 'It is complicated.', 'start': 293.705, 'duration': 0.88}, {'end': 297.508, 'text': 'See, I have an XML over here.', 'start': 294.765, 'duration': 2.743}, {'end': 298.648, 'text': 'This is one XML I have.', 'start': 297.548, 'duration': 1.1}, {'end': 307.511, 'text': 'parse this in the Java program, then how can I do?', 'start': 302.608, 'duration': 4.903}, {'end': 311.453, 'text': 'So I have to write my own code to parse it right?', 'start': 307.851, 'duration': 3.602}], 'summary': 'Using dom, developers can write to sacs for reading xml files, simplifying the process.', 'duration': 33.08, 'max_score': 278.373, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU278373.jpg'}, {'end': 367.229, 'src': 'embed', 'start': 341.376, 'weight': 3, 'content': [{'end': 347.421, 'text': 'Why to reinvent the wheel? So if somebody has already written, then let me make use of it.', 'start': 341.376, 'duration': 6.045}, {'end': 350.943, 'text': 'DOM and SACS parser is used to parse the XML file.', 'start': 347.921, 'duration': 3.022}, {'end': 354.686, 'text': 'Using this, the code can be developed fast and accurate.', 'start': 351.343, 'duration': 3.343}, {'end': 357.847, 'text': "That's why I use DOMR SACS parser.", 'start': 355.366, 'duration': 2.481}, {'end': 367.229, 'text': 'It is already inbuilt, so I can make use of it rather than reinventing the wheel, rather than me writing it again and again.', 'start': 358.207, 'duration': 9.022}], 'summary': 'Using dom and sacs parser for fast, accurate xml file parsing.', 'duration': 25.853, 'max_score': 341.376, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU341376.jpg'}, {'end': 440.052, 'src': 'heatmap', 'start': 409.988, 'weight': 0.755, 'content': [{'end': 417.164, 'text': "Whenever any element is read, so element means, let's say like in book, catalog is a root element.", 'start': 409.988, 'duration': 7.176}, {'end': 427.328, 'text': 'So whenever a catalog is read, it calls the start document method.', 'start': 417.585, 'duration': 9.743}, {'end': 433.029, 'text': 'Then whenever it reads a tag, CD or a title, it calls start element.', 'start': 427.828, 'duration': 5.201}, {'end': 440.052, 'text': 'When it reads the data, empire mostly queue, then it reads a function called characters.', 'start': 433.69, 'duration': 6.362}], 'summary': 'Reading elements triggers specific functions like start document and start element.', 'duration': 30.064, 'max_score': 409.988, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU409988.jpg'}, {'end': 641.404, 'src': 'embed', 'start': 540.584, 'weight': 4, 'content': [{'end': 542.707, 'text': 'Okay, now, let me open the code.', 'start': 540.584, 'duration': 2.123}, {'end': 605.364, 'text': "Okay, here I'm generating the document.", 'start': 599.659, 'duration': 5.705}, {'end': 617.215, 'text': "Okay, so here I'm using the DOM parser.", 'start': 614.973, 'duration': 2.242}, {'end': 619.037, 'text': "I'm writing an XML file.", 'start': 617.635, 'duration': 1.402}, {'end': 620.338, 'text': "I'm creating an XML file.", 'start': 619.057, 'duration': 1.281}, {'end': 625.912, 'text': 'XML file will have this format students as a root element.', 'start': 621.428, 'duration': 4.484}, {'end': 627.693, 'text': 'student name.', 'start': 625.912, 'duration': 1.781}, {'end': 630.556, 'text': 'student is a branch element under student.', 'start': 627.693, 'duration': 2.863}, {'end': 633.718, 'text': 'I have name, email, mobile and address.', 'start': 630.556, 'duration': 3.162}, {'end': 641.404, 'text': 'So when I run this program, so I will get the output like this.', 'start': 634.879, 'duration': 6.525}], 'summary': 'Generating an xml file with student details using dom parser.', 'duration': 100.82, 'max_score': 540.584, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU540584.jpg'}], 'start': 1.121, 'title': 'Xml parser: dom vs sacs', 'summary': 'Discusses the difference between dom and sacs xml parsers, emphasizing that dom is tree-based, while sacs is event-based. it highlights the speed difference, stating that dom is slower than sacs, and mentions sacs is used for parsing big xml files.', 'chapters': [{'end': 695.582, 'start': 1.121, 'title': 'Xml parser: dom vs sacs', 'summary': 'Discusses the difference between dom and sacs xml parsers, highlighting that dom is tree-based, while sacs is event-based, with dom reading entire documents and sacs parsing node by node. it also emphasizes the speed difference between the two parsers, stating that dom is slower than sacs and that sacs is used for parsing big xml files.', 'duration': 694.461, 'highlights': ['The chapter explains the difference between DOM and SACS XML parsers, highlighting that DOM is tree-based and SACS is event-based, with DOM reading entire documents and SACS parsing node by node.', 'The discussion emphasizes the speed difference between the two parsers, stating that DOM is slower than SACS and that SACS is used for parsing big XML files.', 'It is mentioned that DOM can insert and delete nodes, while SACS cannot, and that using DOM, one can write data as well, whereas with SACS, only reading is possible.', 'The chapter mentions that using built-in parsers like DOM and SACS can save time and avoid reinventing the wheel, as they are inbuilt and can be used for fast and accurate development of code for parsing XML files.', 'The transcript provides an example of generating an XML file using the DOM parser, creating a structured output with student details such as name, email, mobile, and address.']}], 'duration': 694.461, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1121.jpg', 'highlights': ['DOM is tree-based, SACS is event-based, with DOM reading entire documents and SACS parsing node by node.', 'DOM is slower than SACS, and SACS is used for parsing big XML files.', 'DOM can insert and delete nodes, while SACS cannot. Using DOM, one can write data as well, whereas with SACS, only reading is possible.', 'Using built-in parsers like DOM and SACS can save time and avoid reinventing the wheel, as they are inbuilt and can be used for fast and accurate development of code for parsing XML files.', 'Example of generating an XML file using the DOM parser, creating a structured output with student details such as name, email, mobile, and address.']}, {'end': 888.639, 'segs': [{'end': 792.331, 'src': 'embed', 'start': 695.722, 'weight': 0, 'content': [{'end': 700.567, 'text': 'If I refresh this, it should, see here, charan.', 'start': 695.722, 'duration': 4.845}, {'end': 714.86, 'text': 'Okay So exactly what you are doing is, there is a factory pattern called, in the design patterns you have something called a factory pattern.', 'start': 701.088, 'duration': 13.772}, {'end': 719.848, 'text': 'Using factory pattern you are getting a document object.', 'start': 715.961, 'duration': 3.887}, {'end': 724.553, 'text': "Here, you're a document builder, so you're getting a DOM object.", 'start': 721.092, 'duration': 3.461}, {'end': 729.434, 'text': "In using the DOM object, you're getting a new document.", 'start': 725.033, 'duration': 4.401}, {'end': 731.455, 'text': 'So b.newDocument.', 'start': 730.255, 'duration': 1.2}, {'end': 735.576, 'text': "So that means it's like a fresh Word doc you're opening.", 'start': 731.915, 'duration': 3.661}, {'end': 739.337, 'text': "In that doc, you'll be writing complete information.", 'start': 736.076, 'duration': 3.261}, {'end': 742.138, 'text': "So completely like this, you'll be writing.", 'start': 740.437, 'duration': 1.701}, {'end': 744.812, 'text': 'see here.', 'start': 743.971, 'duration': 0.841}, {'end': 747.453, 'text': 'document builder, factory dot, new instance.', 'start': 744.812, 'duration': 2.641}, {'end': 754.557, 'text': 'so for anything, first you have to, like you know, you have to use a factory pattern in the J2EE or as core java.', 'start': 747.453, 'duration': 7.104}, {'end': 756.078, 'text': 'you have a patterns.', 'start': 754.557, 'duration': 1.521}, {'end': 759.179, 'text': 'are there right?', 'start': 756.078, 'duration': 3.101}, {'end': 765.983, 'text': 'so maybe in the next month I will be starting the design patterns class with H.O.', 'start': 759.179, 'duration': 6.804}, {'end': 779.127, 'text': 'Rekha. so actually, the design patterns design patterns specify What are the different ways of writing a design?', 'start': 766.023, 'duration': 13.104}, {'end': 783.869, 'text': "When you're designing the code, what are the things you should consider?", 'start': 780.148, 'duration': 3.721}, {'end': 786.37, 'text': 'So there are some patterns are there?', 'start': 784.909, 'duration': 1.461}, {'end': 792.331, 'text': 'Some are like, you know, creational, structural, and behavioral.', 'start': 786.71, 'duration': 5.621}], 'summary': 'Using factory pattern to create new document in the design patterns class with h.o. rekha, covering creational, structural, and behavioral patterns.', 'duration': 96.609, 'max_score': 695.722, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU695722.jpg'}, {'end': 888.639, 'src': 'embed', 'start': 861.721, 'weight': 1, 'content': [{'end': 866.504, 'text': 'A new instance, it will return the instance for a factory pattern.', 'start': 861.721, 'duration': 4.783}, {'end': 870.827, 'text': 'It will create an object and return that object for the factory pattern.', 'start': 866.564, 'duration': 4.263}, {'end': 877.331, 'text': 'Using this factory pattern object only, then you will be able to create a DOM object.', 'start': 871.467, 'duration': 5.864}, {'end': 881.714, 'text': 'This is a factory for document builder.', 'start': 879.052, 'duration': 2.662}, {'end': 888.639, 'text': 'So document builder factory object will create document objects, document builder objects.', 'start': 882.235, 'duration': 6.404}], 'summary': 'A new instance returns an object for the factory pattern, enabling creation of dom and document builder objects.', 'duration': 26.918, 'max_score': 861.721, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU861721.jpg'}], 'start': 695.722, 'title': 'Factory pattern in design patterns', 'summary': 'Introduces the factory pattern in design patterns, focusing on its usage to obtain a document object, and its application in designing code, including creational, structural, and behavioral patterns in j2ee or core java.', 'chapters': [{'end': 759.179, 'start': 695.722, 'title': 'Factory pattern in design patterns', 'summary': 'Discusses the usage of the factory pattern to obtain a document object in design patterns, emphasizing the process of creating a new document using the factory pattern in j2ee or core java.', 'duration': 63.457, 'highlights': ['The process involves using a factory pattern to obtain a document object, specifically a DOM object, and then creating a new document using b.newDocument.', 'Emphasizes the usage of the factory pattern in J2EE or core Java for creating new documents.']}, {'end': 888.639, 'start': 759.179, 'title': 'Design patterns class and factory pattern', 'summary': 'Discusses the upcoming design patterns class, highlighting the concept of factory pattern and its application in designing code, specifying creational, structural, and behavioral patterns.', 'duration': 129.46, 'highlights': ['The design patterns class with H.O. Rekha will cover the concept of factory pattern, specifying different ways of writing a design, including creational, structural, and behavioral patterns.', 'The factory pattern is explained as a method to manufacture objects, with an example of creating a new document using the document builder factory object.', 'The factory pattern is exemplified with a factory for creating DOM objects, where using the factory pattern object, one can create a new instance for the factory pattern.']}], 'duration': 192.917, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU695722.jpg', 'highlights': ['The process involves using a factory pattern to obtain a document object, specifically a DOM object, and then creating a new document using b.newDocument.', 'The factory pattern is exemplified with a factory for creating DOM objects, where using the factory pattern object, one can create a new instance for the factory pattern.', 'The design patterns class with H.O. Rekha will cover the concept of factory pattern, specifying different ways of writing a design, including creational, structural, and behavioral patterns.', 'Emphasizes the usage of the factory pattern in J2EE or core Java for creating new documents.', 'The factory pattern is explained as a method to manufacture objects, with an example of creating a new document using the document builder factory object.']}, {'end': 1403.392, 'segs': [{'end': 945.397, 'src': 'embed', 'start': 890.615, 'weight': 3, 'content': [{'end': 896.938, 'text': 'As I said, if it is like chocolates factory, so the factory of chocolates will make chocolates.', 'start': 890.615, 'duration': 6.323}, {'end': 900.179, 'text': 'This is a factory of document builder factory.', 'start': 897.698, 'duration': 2.481}, {'end': 902.98, 'text': 'It will make document builder objects.', 'start': 900.779, 'duration': 2.201}, {'end': 911.444, 'text': 'Now, using this, we are creating a new document.', 'start': 906.842, 'duration': 4.602}, {'end': 916.506, 'text': 'Here, these are all specifying the elements, that is, students.', 'start': 912.724, 'duration': 3.782}, {'end': 917.306, 'text': 'Look at here.', 'start': 916.766, 'duration': 0.54}, {'end': 925.841, 'text': 'students, student name, email, mobile address, everything here are elements over here.', 'start': 919.389, 'duration': 6.452}, {'end': 928.605, 'text': 'Creating element.', 'start': 927.864, 'duration': 0.741}, {'end': 931.951, 'text': 'Now next portion is you are specifying the data here.', 'start': 929.367, 'duration': 2.584}, {'end': 936.186, 'text': 'Create text node, create text node, create text node, create text node.', 'start': 933.143, 'duration': 3.043}, {'end': 942.413, 'text': 'What data you want to specify here is part of text 1, text 2, text 3, text 4 like that.', 'start': 936.246, 'duration': 6.167}, {'end': 945.397, 'text': 'You are specifying the textual information.', 'start': 942.814, 'duration': 2.583}], 'summary': 'Factory creates document builder objects for student information.', 'duration': 54.782, 'max_score': 890.615, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU890615.jpg'}, {'end': 1028.839, 'src': 'embed', 'start': 999.152, 'weight': 4, 'content': [{'end': 1001.614, 'text': 'See here, root element, create element.', 'start': 999.152, 'duration': 2.462}, {'end': 1002.874, 'text': 'It is also one more tag.', 'start': 1001.674, 'duration': 1.2}, {'end': 1003.795, 'text': "I'll come to that.", 'start': 1003.174, 'duration': 0.621}, {'end': 1013.176, 'text': 'So now, first, you are defining all the elements of the XML file.', 'start': 1005.174, 'duration': 8.002}, {'end': 1016.177, 'text': 'all the elements, all the tags of the XML file.', 'start': 1013.176, 'duration': 3.001}, {'end': 1018.397, 'text': 'you are defining all the data of the XML file.', 'start': 1016.177, 'duration': 2.22}, {'end': 1019.898, 'text': 'you are attaching data with the tags.', 'start': 1018.397, 'duration': 1.501}, {'end': 1028.839, 'text': 'Then what are you doing? Now you are ready with name, name is ready, email is ready, mobile is ready, address is ready.', 'start': 1021.098, 'duration': 7.741}], 'summary': 'Defining elements and data for an xml file, including name, email, mobile, and address.', 'duration': 29.687, 'max_score': 999.152, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU999152.jpg'}, {'end': 1073.998, 'src': 'embed', 'start': 1048.133, 'weight': 0, 'content': [{'end': 1053.517, 'text': 'Now you are attaching all the name element, email element, mobile element, address element to student element.', 'start': 1048.133, 'duration': 5.384}, {'end': 1056.579, 'text': 'So that means this is forming here.', 'start': 1053.957, 'duration': 2.622}, {'end': 1061.284, 'text': 'So these four things are attached to this one now.', 'start': 1058.12, 'duration': 3.164}, {'end': 1062.906, 'text': 'Now this is formed.', 'start': 1061.984, 'duration': 0.922}, {'end': 1068.172, 'text': 'Now this student has to attach to the root element.', 'start': 1064.307, 'duration': 3.865}, {'end': 1073.998, 'text': 'See this student element has to go with the root element.', 'start': 1069.193, 'duration': 4.805}], 'summary': 'Attaching name, email, mobile, and address elements to student element forming a structure.', 'duration': 25.865, 'max_score': 1048.133, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1048133.jpg'}, {'end': 1180.259, 'src': 'embed', 'start': 1146.75, 'weight': 2, 'content': [{'end': 1158.839, 'text': 'Now, once you attach the root element, what are you doing? creating a factory pattern, document builder factory.', 'start': 1146.75, 'duration': 12.089}, {'end': 1166.367, 'text': 'Similarly you are building a transformer factory and you are creating an object of a transformer.', 'start': 1159.74, 'duration': 6.627}, {'end': 1172.013, 'text': 'So that is transformer factory dot new instance dot new transformer.', 'start': 1167.328, 'duration': 4.685}, {'end': 1180.259, 'text': 'So, using this transformer, you will convert the data which is in DOM format to the XML format.', 'start': 1172.834, 'duration': 7.425}], 'summary': 'Building a factory pattern for transformer to convert data from dom to xml.', 'duration': 33.509, 'max_score': 1146.75, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1146750.jpg'}, {'end': 1327.271, 'src': 'embed', 'start': 1296.126, 'weight': 1, 'content': [{'end': 1301.871, 'text': 'The root is put into the document, which has the document object, which is the document object.', 'start': 1296.126, 'duration': 5.745}, {'end': 1304.333, 'text': 'Then you create a transformer object.', 'start': 1302.251, 'duration': 2.082}, {'end': 1308.256, 'text': 'From the transformer object, convert to the file.', 'start': 1304.613, 'duration': 3.643}, {'end': 1312.645, 'text': 'This is how you write an XML file.', 'start': 1309.839, 'duration': 2.806}, {'end': 1314.929, 'text': 'The same thing has been given over here.', 'start': 1313.406, 'duration': 1.523}, {'end': 1320.629, 'text': 'Document to create an XML file.', 'start': 1318.849, 'duration': 1.78}, {'end': 1323.07, 'text': 'In the program, document object is created.', 'start': 1320.81, 'duration': 2.26}, {'end': 1327.271, 'text': 'Elements or nodes of the XML file are created.', 'start': 1323.35, 'duration': 3.921}], 'summary': 'The process involves creating a document and transformer object to write an xml file.', 'duration': 31.145, 'max_score': 1296.126, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1296126.jpg'}], 'start': 890.615, 'title': 'Creating and writing xml documents in java', 'summary': 'Explains creating an xml document using the document builder factory, specifying elements like students, and attaching textual information. it also covers the process of writing an xml file, including creating elements, attaching data, converting to xml format, and reading an xml file using specific java classes and methods.', 'chapters': [{'end': 1019.898, 'start': 890.615, 'title': 'Document builder factory', 'summary': 'Explains the process of creating an xml document using the document builder factory, specifying elements like students, and attaching textual information to these elements.', 'duration': 129.283, 'highlights': ['You are defining all the elements of the XML file and all the data of the XML file, and you are attaching data with the tags.', 'Creating element and specifying the data, such as student name, email, mobile address, and attaching text nodes, T1, T2, T3, T4 to these elements.', 'The factory of document builder factory creates document builder objects to make a new document, specifying elements like students, student name, email, mobile address, and text data T1, T2, T3, T4.']}, {'end': 1403.392, 'start': 1021.098, 'title': 'Xml writing process', 'summary': 'Explains the process of writing an xml file, including creating elements, attaching data, converting to xml format, and reading an xml file, using specific java classes and methods.', 'duration': 382.294, 'highlights': ['Creating and attaching elements to form the XML structure The process involves creating elements for name, email, mobile, and address, then attaching them to the student element before attaching the student element to the root element.', 'Converting data to XML format using transformer factory The speaker explains the use of transformer factory to convert data from DOM format to XML format, using the transformer object to generate an XML file.', 'Explanation of the XML writing process in Java The transcript provides a detailed explanation of the XML writing process in Java, including creating a factory pattern, document builder factory, and document object builder.', 'Reading and defining root tags in an XML file The speaker discusses the process of defining root tags in an XML file and explains the necessity of specifying the root tag in XML file creation.']}], 'duration': 512.777, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU890615.jpg', 'highlights': ['Creating and attaching elements to form the XML structure The process involves creating elements for name, email, mobile, and address, then attaching them to the student element before attaching the student element to the root element.', 'Explanation of the XML writing process in Java The transcript provides a detailed explanation of the XML writing process in Java, including creating a factory pattern, document builder factory, and document object builder.', 'Converting data to XML format using transformer factory The speaker explains the use of transformer factory to convert data from DOM format to XML format, using the transformer object to generate an XML file.', 'The factory of document builder factory creates document builder objects to make a new document, specifying elements like students, student name, email, mobile address, and text data T1, T2, T3, T4.', 'Reading and defining root tags in an XML file The speaker discusses the process of defining root tags in an XML file and explains the necessity of specifying the root tag in XML file creation.', 'Creating element and specifying the data, such as student name, email, mobile address, and attaching text nodes, T1, T2, T3, T4 to these elements.', 'You are defining all the elements of the XML file and all the data of the XML file, and you are attaching data with the tags.']}, {'end': 1706.908, 'segs': [{'end': 1509.659, 'src': 'embed', 'start': 1479.116, 'weight': 1, 'content': [{'end': 1486.558, 'text': "So in using DocumentBuilder object, that is a DOM object, you're parsing the XML file.", 'start': 1479.116, 'duration': 7.442}, {'end': 1493.019, 'text': 'See, for creating the DOM object, you are using a factory pattern.', 'start': 1486.578, 'duration': 6.441}, {'end': 1503.793, 'text': 'So the moment you say parse, this entire XML file is parsed into the tree format.', 'start': 1495.964, 'duration': 7.829}, {'end': 1505.815, 'text': 'It is already made into the tree format.', 'start': 1504.193, 'duration': 1.622}, {'end': 1509.659, 'text': 'Now some of the couple of methods which I am using to display.', 'start': 1506.155, 'duration': 3.504}], 'summary': 'Using documentbuilder object to parse xml file into tree format.', 'duration': 30.543, 'max_score': 1479.116, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1479116.jpg'}, {'end': 1588.071, 'src': 'embed', 'start': 1556.681, 'weight': 0, 'content': [{'end': 1559.445, 'text': 'So it will return you the endless.', 'start': 1556.681, 'duration': 2.764}, {'end': 1565.845, 'text': 'So number of So as I said, the DOM will read in the tree format.', 'start': 1559.505, 'duration': 6.34}, {'end': 1567.506, 'text': 'It will return you two nodes.', 'start': 1566.205, 'duration': 1.301}, {'end': 1572.688, 'text': 'When you look for staff, it returns two nodes for you.', 'start': 1568.166, 'duration': 4.522}, {'end': 1574.268, 'text': 'So node list.', 'start': 1573.188, 'duration': 1.08}, {'end': 1576.99, 'text': 'So it will have list of nodes.', 'start': 1574.508, 'duration': 2.482}, {'end': 1580.131, 'text': 'First node is ID with the 1001.', 'start': 1577.61, 'duration': 2.521}, {'end': 1583.908, 'text': 'Second node is with the ID 2001.', 'start': 1580.131, 'duration': 3.777}, {'end': 1588.071, 'text': 'When I say these are all node lists of all classes of DOM.', 'start': 1583.908, 'duration': 4.163}], 'summary': 'Dom returns two nodes, 1001 and 2001, for staff.', 'duration': 31.39, 'max_score': 1556.681, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1556681.jpg'}, {'end': 1651.867, 'src': 'embed', 'start': 1625.299, 'weight': 2, 'content': [{'end': 1632.821, 'text': 'Okay, now, if you look at getLength, it will return two, because two branches are there or two nodes are there with staff.', 'start': 1625.299, 'duration': 7.522}, {'end': 1636.502, 'text': "Now what I'm doing, I'm iterating through all the nodes.", 'start': 1633.261, 'duration': 3.241}, {'end': 1641.904, 'text': 'So temp equal to zero, temp less than nlist.getLength.', 'start': 1638.023, 'duration': 3.881}, {'end': 1648.506, 'text': 'So it always starts from zero and nlist gives off getLength, it gives me two nodes.', 'start': 1642.144, 'duration': 6.362}, {'end': 1651.867, 'text': 'And temp plus plus, so every time it iterates.', 'start': 1649.767, 'duration': 2.1}], 'summary': 'The getlength function returns two nodes, and the iteration goes through all nodes.', 'duration': 26.568, 'max_score': 1625.299, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1625299.jpg'}, {'end': 1706.908, 'src': 'heatmap', 'start': 1652.207, 'weight': 0.704, 'content': [{'end': 1657.743, 'text': 'So when I say nlist.itemTemp, Okay, temp and node.', 'start': 1652.207, 'duration': 5.536}, {'end': 1662.485, 'text': 'So first the node, whatever it is available for 1001, it is written.', 'start': 1658.063, 'duration': 4.422}, {'end': 1666.786, 'text': 'Okay, so this one, this complete node is given over here.', 'start': 1663.185, 'duration': 3.601}, {'end': 1670.647, 'text': 'Okay, then nNode.getNodeName.', 'start': 1667.506, 'duration': 3.141}, {'end': 1673.828, 'text': 'So that means the node name is staff here.', 'start': 1672.027, 'duration': 1.801}, {'end': 1677.873, 'text': "Then I'm, is it an element node? Yes, it's an element node.", 'start': 1675.011, 'duration': 2.862}, {'end': 1686.737, 'text': "Then what I'm seeing, converting, if it is an element node, I'm converting this entire node to an element, so that I can read each and every element.", 'start': 1678.113, 'duration': 8.624}, {'end': 1689.359, 'text': 'Now coming back here.', 'start': 1687.918, 'duration': 1.441}, {'end': 1698.283, 'text': 'so when I say get attribute this data, whatever is the ID which is attribute data here, it is written using get attribute method.', 'start': 1689.359, 'duration': 8.924}, {'end': 1700.605, 'text': "So staff ID I'm displaying then.", 'start': 1698.604, 'duration': 2.001}, {'end': 1705.127, 'text': 'So I have big method here, element.', 'start': 1701.625, 'duration': 3.502}, {'end': 1706.908, 'text': 'This is this element.', 'start': 1705.888, 'duration': 1.02}], 'summary': 'Extracted data from nlist.itemtemp, showing staff id using get attribute method.', 'duration': 54.701, 'max_score': 1652.207, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1652207.jpg'}], 'start': 1406.094, 'title': 'Dom parsing and javascript iteration', 'summary': 'Covers dom parsing using documentbuilder and its associated methods for reading and manipulating xml files, as well as explaining the usage of dom methods like getelementbyid, getdocumentelement, and getelementsbytagname to retrieve specific elements and node lists. it also focuses on demonstrating the process of iterating through a node list in javascript to retrieve and display information about nodes and branches, with a specific example yielding a count of two nodes.', 'chapters': [{'end': 1509.659, 'start': 1406.094, 'title': 'Dom parsing and methods', 'summary': 'Covers dom parsing using documentbuilder and its associated methods for reading and manipulating xml files, emphasizing the use of the factory pattern and text elements, while also addressing the limitations of using string instead of text in the w3 dom.', 'duration': 103.565, 'highlights': ["Using DocumentBuilder object, which is a DOM object, to parse the XML file into a tree format. The moment 'parse' is invoked, the entire XML file is parsed into the tree format, using the factory pattern to create the DOM object.", 'Emphasizing the use of text elements and the limitations of using string in the W3 DOM. Vishal is reminded to use text only instead of string due to the way the methods are written in the W3 DOM, highlighting the importance of adhering to this practice.', "Reading staff.xml as the XML file and building the document using DocumentBuilderFactory. The file 'staff.xml' is read and used to build a document using DocumentBuilderFactory, demonstrating the process of parsing and manipulating XML files."]}, {'end': 1588.071, 'start': 1509.659, 'title': 'Dom methods and node lists', 'summary': "Explains the usage of dom methods like getelementbyid, getdocumentelement, and getelementsbytagname to retrieve specific elements and node lists from the document, with examples showing the retrieval of root elements and node lists based on tag names, such as 'company' and 'staff'.", 'duration': 78.412, 'highlights': ["The DOM method getDocumentElement retrieves the root element, displaying 'company' as the node name. This method returns the root element of the document with the node name 'company'.", "The method getElementsByTagName returns a node list of elements with the specified tag name, such as 'staff', resulting in the retrieval of two nodes with IDs 1001 and 2001. Using this method returns a node list containing elements with the tag name 'staff', resulting in the retrieval of two nodes with IDs 1001 and 2001."]}, {'end': 1706.908, 'start': 1588.572, 'title': 'Javascript node list and iteration', 'summary': 'Focuses on demonstrating the process of iterating through a node list in javascript to retrieve and display information about nodes and branches, with a specific example yielding a count of two nodes, as well as detailed information about each node and its attributes.', 'duration': 118.336, 'highlights': ["The process returns a count of two nodes or branches, demonstrating the functionality of 'getLength' method in retrieving the total number of nodes or branches.", "The iteration process for all nodes is explained, with the 'temp' variable used to iterate through the list of nodes, demonstrating the use of 'getLength' method to retrieve the total number of nodes and branches.", "The detailed process of accessing and displaying information about each node, including the node name, element node check, and attribute extraction, is outlined with a specific example showcasing the retrieval of 'staff ID' using 'getAttribute' method."]}], 'duration': 300.814, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1406094.jpg', 'highlights': ["The method getElementsByTagName returns a node list of elements with the specified tag name, such as 'staff', resulting in the retrieval of two nodes with IDs 1001 and 2001.", "Using DocumentBuilder object, which is a DOM object, to parse the XML file into a tree format. The moment 'parse' is invoked, the entire XML file is parsed into the tree format, using the factory pattern to create the DOM object.", "The process returns a count of two nodes or branches, demonstrating the functionality of 'getLength' method in retrieving the total number of nodes or branches.", "The iteration process for all nodes is explained, with the 'temp' variable used to iterate through the list of nodes, demonstrating the use of 'getLength' method to retrieve the total number of nodes and branches."]}, {'end': 2070.418, 'segs': [{'end': 1914.103, 'src': 'embed', 'start': 1881.18, 'weight': 0, 'content': [{'end': 1890.107, 'text': 'Otherwise, what you can do is, See, you can use DOM for parsing rather than display.', 'start': 1881.18, 'duration': 8.927}, {'end': 1899.215, 'text': 'You can create an object of the employee and you can assign the data and put that data into the hash map.', 'start': 1891.028, 'duration': 8.187}, {'end': 1899.995, 'text': 'That is possible.', 'start': 1899.275, 'duration': 0.72}, {'end': 1908.519, 'text': 'Have you got it, Siddhartha? So for parsing, you can use DOM.', 'start': 1903.739, 'duration': 4.78}, {'end': 1910.52, 'text': 'You will get the data from the XML.', 'start': 1908.719, 'duration': 1.801}, {'end': 1914.103, 'text': 'After you read the data, you create an object of employee.', 'start': 1910.801, 'duration': 3.302}], 'summary': 'Use dom for parsing xml data and create an employee object for data processing.', 'duration': 32.923, 'max_score': 1881.18, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1881180.jpg'}, {'end': 2074.481, 'src': 'heatmap', 'start': 1947.538, 'weight': 3, 'content': [{'end': 1950.36, 'text': 'It is the same thing like I have given over here.', 'start': 1947.538, 'duration': 2.822}, {'end': 1952.881, 'text': 'Passing the XML using DOM.', 'start': 1950.64, 'duration': 2.241}, {'end': 1956.963, 'text': 'XML file is read into tree using DOM parts.', 'start': 1953.441, 'duration': 3.522}, {'end': 1962.525, 'text': 'The moment you use parse over here, it is constructing the tree format.', 'start': 1958.463, 'duration': 4.062}, {'end': 1965.726, 'text': 'You have the XML.', 'start': 1964.906, 'duration': 0.82}, {'end': 1967.727, 'text': 'It constructs into a tree format.', 'start': 1966.087, 'duration': 1.64}, {'end': 1974.61, 'text': 'Number of branches are determined and all the leaf nodes are read through iterating all the branches in DOM.', 'start': 1968.247, 'duration': 6.363}, {'end': 1985.8, 'text': 'Get node name returns a name, get attribute returns xml and get elements by tag name returns the data of the node for the corresponding node name.', 'start': 1975.05, 'duration': 10.75}, {'end': 1988.362, 'text': 'Now this is the sax import.', 'start': 1986.24, 'duration': 2.122}, {'end': 2002.735, 'text': 'So these are all the imports you have to do for a sax, like xml parser dot sax parser, xml parser dot sax, or you can say sax parser dot star.', 'start': 1988.842, 'duration': 13.893}, {'end': 2007.039, 'text': 'or gxml.sax.star.', 'start': 2004.758, 'duration': 2.281}, {'end': 2013.662, 'text': 'so, like you know it, load all the corresponding classifier which you require.', 'start': 2007.039, 'duration': 6.623}, {'end': 2024.948, 'text': "ok, now let's look at the sax parser.", 'start': 2013.662, 'duration': 11.286}, {'end': 2029.11, 'text': 'look here now I have a class.', 'start': 2024.948, 'duration': 4.162}, {'end': 2033.952, 'text': 'I have a class which says my sax handler ok, extends default handler.', 'start': 2029.11, 'duration': 4.842}, {'end': 2038.036, 'text': 'Now, as I said before, start document.', 'start': 2035.375, 'duration': 2.661}, {'end': 2040.157, 'text': 'the moment root of the XML file is read', 'start': 2038.036, 'duration': 2.121}, {'end': 2043.259, 'text': 'Start element every element of the XML.', 'start': 2040.638, 'duration': 2.621}, {'end': 2047.021, 'text': 'For example, you see here staff is an element.', 'start': 2043.379, 'duration': 3.642}, {'end': 2047.941, 'text': 'first name is an element.', 'start': 2047.021, 'duration': 0.92}, {'end': 2048.9, 'text': 'last name is an element.', 'start': 2047.941, 'duration': 0.959}, {'end': 2049.661, 'text': 'nickname is an element.', 'start': 2048.9, 'duration': 0.761}, {'end': 2050.722, 'text': 'salary is an element.', 'start': 2049.661, 'duration': 1.061}, {'end': 2051.623, 'text': 'company is an element.', 'start': 2050.722, 'duration': 0.901}, {'end': 2057.387, 'text': 'Whenever each element is read, okay, it calls a method called startElement.', 'start': 2052.683, 'duration': 4.704}, {'end': 2067.335, 'text': 'Whenever you read the data, see here, like, you know, introduction to Java, Charon, 103, 101, see this is all the data.', 'start': 2058.088, 'duration': 9.247}, {'end': 2070.418, 'text': 'Whenever the data is read, it calls the characters method.', 'start': 2067.415, 'duration': 3.003}, {'end': 2074.481, 'text': "Whenever the end tag is read, then it'll call the end element.", 'start': 2070.797, 'duration': 3.684}], 'summary': 'Using dom and sax to process xml, creating tree structure, and parsing elements and attributes.', 'duration': 126.943, 'max_score': 1947.538, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1947538.jpg'}, {'end': 2081.687, 'src': 'embed', 'start': 2047.021, 'weight': 4, 'content': [{'end': 2047.941, 'text': 'first name is an element.', 'start': 2047.021, 'duration': 0.92}, {'end': 2048.9, 'text': 'last name is an element.', 'start': 2047.941, 'duration': 0.959}, {'end': 2049.661, 'text': 'nickname is an element.', 'start': 2048.9, 'duration': 0.761}, {'end': 2050.722, 'text': 'salary is an element.', 'start': 2049.661, 'duration': 1.061}, {'end': 2051.623, 'text': 'company is an element.', 'start': 2050.722, 'duration': 0.901}, {'end': 2057.387, 'text': 'Whenever each element is read, okay, it calls a method called startElement.', 'start': 2052.683, 'duration': 4.704}, {'end': 2067.335, 'text': 'Whenever you read the data, see here, like, you know, introduction to Java, Charon, 103, 101, see this is all the data.', 'start': 2058.088, 'duration': 9.247}, {'end': 2070.418, 'text': 'Whenever the data is read, it calls the characters method.', 'start': 2067.415, 'duration': 3.003}, {'end': 2074.481, 'text': "Whenever the end tag is read, then it'll call the end element.", 'start': 2070.797, 'duration': 3.684}, {'end': 2081.687, 'text': 'Whenever end document, that is the document, the XML file is ending, it calls the method called end document.', 'start': 2074.86, 'duration': 6.827}], 'summary': 'Parsing xml elements and data with corresponding methods.', 'duration': 34.666, 'max_score': 2047.021, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2047021.jpg'}], 'start': 1708.329, 'title': 'Dom and xml parsing', 'summary': 'Covers the basics of dom parsing, including the retrieval of data from nodes and display of attributes. it also discusses xml parsing using dom, focusing on creating and populating objects. additionally, the chapter delves into xml parsing using dom and sax, highlighting tree construction and element handling.', 'chapters': [{'end': 1835.304, 'start': 1708.329, 'title': 'Dom parsing basics', 'summary': 'Explains the process of parsing elements by tag name and extracting text content using dom, resulting in the retrieval of data from nodes and the display of specific attributes. the example demonstrates the retrieval of specific data from nodes and the display of extracted values, as well as the total number of nodes and their attributes.', 'duration': 126.975, 'highlights': ['The chapter explains the process of parsing elements by tag name and extracting text content using DOM, resulting in the retrieval of data from nodes and the display of specific attributes. The example demonstrates the retrieval of specific data from nodes and the display of extracted values, as well as the total number of nodes and their attributes.', 'The code displays retrieved data such as first name, last name, nickname, and salary, along with the total number of nodes which is 2.', 'The example showcases the retrieval of specific attributes such as staff ID and the corresponding values, including salary amounts, using DOM parsing.']}, {'end': 1947.438, 'start': 1839.302, 'title': 'Parsing xml using dom', 'summary': 'Discusses the process of parsing xml using dom, including creating an employee object with specific details and using setter and getter methods to populate the object and store it in a hash map.', 'duration': 108.136, 'highlights': ['The process of parsing XML using DOM involves creating an employee object with details such as ID, first name, last name, nickname, and salary, and then using setter and getter methods to populate the object and store it in a hash map.', 'Parsing XML using DOM allows for the efficient extraction of data from the XML and the creation of an employee object, which can then be stored in a hash map for further processing.']}, {'end': 2070.418, 'start': 1947.538, 'title': 'Xml parsing using dom and sax', 'summary': 'Discusses the process of xml parsing using dom and sax, emphasizing the construction of a tree format using dom and the handling of elements and data using sax, with an emphasis on the startelement and characters methods.', 'duration': 122.88, 'highlights': ['The XML file is read into a tree using DOM, where the parse method constructs the tree format.', 'The startElement method is called for every element of the XML, such as staff, first name, last name, etc., when using SAX parsing.', "The characters method is called when reading data from the XML, such as 'introduction to Java', 'Charon', '103', '101', etc., during SAX parsing.", 'The number of branches in the XML tree is determined and all the leaf nodes are read through iterating all the branches in DOM.', 'The imports required for SAX parsing include xml parser dot sax parser, xml parser dot sax, sax parser dot star, or gxml.sax.star.']}], 'duration': 362.089, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU1708329.jpg', 'highlights': ['The process of parsing XML using DOM involves creating an employee object with details such as ID, first name, last name, nickname, and salary, and then using setter and getter methods to populate the object and store it in a hash map.', 'The example showcases the retrieval of specific attributes such as staff ID and the corresponding values, including salary amounts, using DOM parsing.', 'Parsing XML using DOM allows for the efficient extraction of data from the XML and the creation of an employee object, which can then be stored in a hash map for further processing.', 'The XML file is read into a tree using DOM, where the parse method constructs the tree format.', 'The startElement method is called for every element of the XML, such as staff, first name, last name, etc., when using SAX parsing.', "The characters method is called when reading data from the XML, such as 'introduction to Java', 'Charon', '103', '101', etc., during SAX parsing."]}, {'end': 2319.339, 'segs': [{'end': 2100.096, 'src': 'embed', 'start': 2070.797, 'weight': 0, 'content': [{'end': 2074.481, 'text': "Whenever the end tag is read, then it'll call the end element.", 'start': 2070.797, 'duration': 3.684}, {'end': 2081.687, 'text': 'Whenever end document, that is the document, the XML file is ending, it calls the method called end document.', 'start': 2074.86, 'duration': 6.827}, {'end': 2094.507, 'text': 'So, in the public static void main, the way you are building the DOM object, you have to build a SACS object also, SACS parser object.', 'start': 2082.467, 'duration': 12.04}, {'end': 2098.876, 'text': 'So for that, again, you have to use factory.', 'start': 2095.674, 'duration': 3.202}, {'end': 2100.096, 'text': 'This is how it is designed.', 'start': 2098.976, 'duration': 1.12}], 'summary': 'Xml parsing involves calling methods like end element and end document when reading end tags, and building a sacs parser object using a factory in the main method.', 'duration': 29.299, 'max_score': 2070.797, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2070797.jpg'}, {'end': 2218.327, 'src': 'embed', 'start': 2184.916, 'weight': 3, 'content': [{'end': 2189.92, 'text': 'So whatever we have written in the XML file, okay, using DOM.', 'start': 2184.916, 'duration': 5.004}, {'end': 2191.1, 'text': 'we are reading using SACS.', 'start': 2189.92, 'duration': 1.18}, {'end': 2193.242, 'text': 'I can take any XML file.', 'start': 2191.861, 'duration': 1.381}, {'end': 2194.863, 'text': 'See, let me run this code and show you.', 'start': 2193.262, 'duration': 1.601}, {'end': 2200.274, 'text': 'see here.', 'start': 2199.133, 'duration': 1.141}, {'end': 2202.195, 'text': 'document begins here students.', 'start': 2200.274, 'duration': 1.921}, {'end': 2204.777, 'text': 'student name deep ok.', 'start': 2202.195, 'duration': 2.582}, {'end': 2206.819, 'text': 'email deep123 at gmail.com.', 'start': 2204.777, 'duration': 2.042}, {'end': 2209.2, 'text': '3456 London.', 'start': 2206.819, 'duration': 2.381}, {'end': 2210.601, 'text': 'right, so I have written.', 'start': 2209.2, 'duration': 1.401}, {'end': 2218.327, 'text': "so if I modify this, like you know, I'll modify this to UK and this is, like you know, 5678.", 'start': 2210.601, 'duration': 7.726}], 'summary': 'Using dom, xml data is read and modified, e.g., student name, email, and location.', 'duration': 33.411, 'max_score': 2184.916, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2184916.jpg'}, {'end': 2325.302, 'src': 'embed', 'start': 2293.344, 'weight': 1, 'content': [{'end': 2296.047, 'text': 'See here, new instance is a static method, SACS parser factory.', 'start': 2293.344, 'duration': 2.703}, {'end': 2299.318, 'text': 'obtains a new instance of a SACS parser factory.', 'start': 2296.795, 'duration': 2.523}, {'end': 2303.403, 'text': 'This is a static method, creates a new factory.', 'start': 2299.338, 'duration': 4.065}, {'end': 2307.107, 'text': 'So basically it is a static method.', 'start': 2305.205, 'duration': 1.902}, {'end': 2311.271, 'text': 'This is a class, the SACS parser factory.', 'start': 2308.008, 'duration': 3.263}, {'end': 2315.736, 'text': 'So you will get an object of SACS parser factory.', 'start': 2311.992, 'duration': 3.744}, {'end': 2319.339, 'text': 'With that you are saying new SACS parser.', 'start': 2316.977, 'duration': 2.362}, {'end': 2325.302, 'text': 'So you are using this line, you are generating object of SACS parser.', 'start': 2319.479, 'duration': 5.823}], 'summary': "Sacs parser factory's static method generates new factory and parser objects.", 'duration': 31.958, 'max_score': 2293.344, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2293344.jpg'}], 'start': 2070.797, 'title': 'Sacs parser and xml parsing', 'summary': 'Covers the usage of a sacs parser for xml parsing, emphasizing the need to create a sacs parser object using a factory pattern and the instantiation of a sacs parser factory object. it also explains how to read and parse xml using sacs parser, demonstrating the process with an example of reading and modifying an xml file, and generating a new xml file using dom, while highlighting the use of factory pattern and static methods in sacs parser factory.', 'chapters': [{'end': 2141.622, 'start': 2070.797, 'title': 'Sacs parser and xml parsing', 'summary': 'Covers the usage of a sacs parser for xml parsing, emphasizing the need to create a sacs parser object using a factory pattern and the instantiation of a sacs parser factory object. it also explains the significance of calling the end element and end document methods when processing xml files.', 'duration': 70.825, 'highlights': ['The importance of calling the end element and end document methods when processing XML files The chapter emphasizes the significance of calling the end element and end document methods when processing XML files, ensuring proper handling and closure of the XML file.', 'Usage of a SACS parser object using a factory pattern It explains the need to create a SACS parser object using a factory pattern, highlighting the use of a SACS parser factory object and the instantiation of a SACS parser.', 'Instantiation of a SACS parser factory object The chapter details the instantiation of a SACS parser factory object using the new instance method, providing insights into the creation of a SACS parser factory object for XML parsing.']}, {'end': 2319.339, 'start': 2141.782, 'title': 'Reading and parsing xml using sacs', 'summary': 'Explains how to read and parse xml using sacs parser, demonstrating the process with an example of reading and modifying an xml file, and generating a new xml file using dom. it also highlights the use of factory pattern and static methods in sacs parser factory.', 'duration': 177.557, 'highlights': ['The chapter explains the process of reading and parsing XML using SACS parser, demonstrating the steps with an example of reading and modifying an XML file, and generating a new XML file using DOM.', 'The transcript provides an example of reading an XML file using SACS, modifying its contents, and generating a new XML file, with the demonstration including specific details such as modifying address from London to UK, and mobile number from 3456 to 5678.', 'It also highlights the use of factory pattern and static methods in SACS parser factory, emphasizing the process of obtaining a new instance of SACS parser factory using the static method new instance.']}], 'duration': 248.542, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2070797.jpg', 'highlights': ['The chapter emphasizes the significance of calling the end element and end document methods when processing XML files, ensuring proper handling and closure of the XML file.', 'It explains the need to create a SACS parser object using a factory pattern, highlighting the use of a SACS parser factory object and the instantiation of a SACS parser.', 'The chapter details the instantiation of a SACS parser factory object using the new instance method, providing insights into the creation of a SACS parser factory object for XML parsing.', 'The chapter explains the process of reading and parsing XML using SACS parser, demonstrating the steps with an example of reading and modifying an XML file, and generating a new XML file using DOM.', 'The transcript provides an example of reading an XML file using SACS, modifying its contents, and generating a new XML file, with the demonstration including specific details such as modifying address from London to UK, and mobile number from 3456 to 5678.', 'It also highlights the use of factory pattern and static methods in SACS parser factory, emphasizing the process of obtaining a new instance of SACS parser factory using the static method new instance.']}, {'end': 2583.183, 'segs': [{'end': 2346.542, 'src': 'embed', 'start': 2319.479, 'weight': 0, 'content': [{'end': 2325.302, 'text': 'So you are using this line, you are generating object of SACS parser.', 'start': 2319.479, 'duration': 5.823}, {'end': 2329.705, 'text': "Why do you need a SACS parser? It's basically to parse the XML file.", 'start': 2325.622, 'duration': 4.083}, {'end': 2331.626, 'text': 'Parsing is reading the XML file.', 'start': 2329.745, 'duration': 1.881}, {'end': 2343.32, 'text': 'Okay, so when I say parse and students.xml, it reads the data and the control, whichever, say if it is a root element, it goes to the start document.', 'start': 2333.675, 'duration': 9.645}, {'end': 2345.281, 'text': 'If it is a start element, it goes here.', 'start': 2343.46, 'duration': 1.821}, {'end': 2346.542, 'text': 'If it is characters, over here.', 'start': 2345.361, 'duration': 1.181}], 'summary': 'Using sacs parser to parse xml file, reading data and control.', 'duration': 27.063, 'max_score': 2319.479, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2319479.jpg'}, {'end': 2396.865, 'src': 'embed', 'start': 2367.02, 'weight': 2, 'content': [{'end': 2372.348, 'text': 'So after the starting the element, see after the start of the element I have provided a space over there.', 'start': 2367.02, 'duration': 5.328}, {'end': 2374.851, 'text': 'Now let me run this, it will remove the spaces.', 'start': 2372.728, 'duration': 2.123}, {'end': 2377.055, 'text': 'See here, it removed the spaces.', 'start': 2375.072, 'duration': 1.983}, {'end': 2391.944, 'text': 'Okay, have you understood the code? So basically, only you have to type this code.', 'start': 2384.341, 'duration': 7.603}, {'end': 2394.104, 'text': 'This code I will be uploading in LMS.', 'start': 2392.324, 'duration': 1.78}, {'end': 2396.865, 'text': 'Go through this code, type this code, and see the output.', 'start': 2394.325, 'duration': 2.54}], 'summary': 'Demonstrating code to remove spaces, uploaded in lms for students to type and see output.', 'duration': 29.845, 'max_score': 2367.02, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2367020.jpg'}, {'end': 2498.327, 'src': 'embed', 'start': 2441.427, 'weight': 3, 'content': [{'end': 2443.769, 'text': 'See, what happens is this is entirely new for you.', 'start': 2441.427, 'duration': 2.342}, {'end': 2447.758, 'text': 'So I can tell you what is DOM, what is SAX.', 'start': 2445.216, 'duration': 2.542}, {'end': 2452.18, 'text': 'I can show you the written code and I can show you it is working fine.', 'start': 2448.098, 'duration': 4.082}, {'end': 2456.602, 'text': 'Now having this information you have to extend it further.', 'start': 2452.48, 'duration': 4.122}, {'end': 2461.465, 'text': 'You have to get the code and you have to type the code rather than copy pasting.', 'start': 2457.563, 'duration': 3.902}, {'end': 2468.509, 'text': 'So copy paste does not get you much because only when you see a couple of errors and fix it then you will become perfect.', 'start': 2462.125, 'duration': 6.384}, {'end': 2480.254, 'text': 'Type the code, generate the XML file, and then your confidence level in the parsers will increase.', 'start': 2469.867, 'duration': 10.387}, {'end': 2494.004, 'text': 'Nile says, which scenario you have to use DOM and SAX? Basically, the XML file is a huge one.', 'start': 2487.179, 'duration': 6.825}, {'end': 2496.225, 'text': 'Then go for SAX parser.', 'start': 2494.364, 'duration': 1.861}, {'end': 2498.327, 'text': 'It will read element by element.', 'start': 2496.706, 'duration': 1.621}], 'summary': 'Learning about dom and sax parsers, emphasizing code typing over copying, to increase confidence and proficiency in xml parsing.', 'duration': 56.9, 'max_score': 2441.427, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2441427.jpg'}, {'end': 2576.341, 'src': 'embed', 'start': 2551.452, 'weight': 6, 'content': [{'end': 2557.094, 'text': 'If it is end of the root, then it will call end document, right? So these are the methods it calls.', 'start': 2551.452, 'duration': 5.642}, {'end': 2558.074, 'text': 'Okay, yeah, I see.', 'start': 2557.314, 'duration': 0.76}, {'end': 2565.898, 'text': 'Start document and end document methods are called when XML document is started to read and after reading the entire document.', 'start': 2558.375, 'duration': 7.523}, {'end': 2572.76, 'text': 'The start document and end document is root element and ending of the root element.', 'start': 2566.458, 'duration': 6.302}, {'end': 2576.341, 'text': 'So when start tag is read, start element is invoked.', 'start': 2573.26, 'duration': 3.081}], 'summary': 'Xml parsing methods are called at start and end of the document, including start and end tags.', 'duration': 24.889, 'max_score': 2551.452, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2551452.jpg'}], 'start': 2319.479, 'title': 'Xml parsing and parsers', 'summary': 'Covers parsing xml using sacs parser for event-based parsing, space removal, and practical implementation; it also explains dom and sax parsers, focusing on their use based on xml file size and the importance of typed code.', 'chapters': [{'end': 2396.865, 'start': 2319.479, 'title': 'Parsing xml with sacs parser', 'summary': 'Explains the use of sacs parser to parse an xml file by reading and processing its data and control elements through event-based parsing, removing spaces from elements, and providing code for practical implementation.', 'duration': 77.386, 'highlights': ['The SACS parser is used to parse the XML file, reading and processing its data and control elements.', 'Parsing with SACS parser is event-based, where corresponding methods are called as it reads the XML file.', 'The code provided removes spaces from elements after the start of the element, demonstrating practical implementation.']}, {'end': 2583.183, 'start': 2396.905, 'title': 'Understanding dom and sax parsers', 'summary': 'Discusses the concepts of dom and sax parsers, when to use them based on the size of the xml file, and the methods invoked during parsing, emphasizing the importance of typing the code for better understanding and confidence building.', 'duration': 186.278, 'highlights': ['The importance of typing the code is emphasized for better understanding and confidence building. The speaker emphasizes the need to type the code instead of copy-pasting to gain a better understanding and increase confidence. Typing the code, generating the XML file, and encountering and fixing errors is highlighted as essential for skill development.', 'Explanation of when to use DOM and SAX parsers based on the size of the XML file. The chapter explains that for huge XML files, the SAX parser is recommended as it reads elements one by one, while for small to medium files, the DOM parser is preferred as it builds the entire tree structure with the XML data.', 'Explanation of the methods invoked during parsing, such as start document, start element, characters, and end element. The methods invoked during parsing, including start document, start element, characters, and end element, are explained. The start and end document methods are specifically highlighted as being called when the XML document starts and after reading the entire document, respectively.']}], 'duration': 263.704, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/aLxrk1vK0ZU/pics/aLxrk1vK0ZU2319479.jpg', 'highlights': ['Parsing with SACS parser is event-based, where corresponding methods are called as it reads the XML file.', 'The SACS parser is used to parse the XML file, reading and processing its data and control elements.', 'The code provided removes spaces from elements after the start of the element, demonstrating practical implementation.', 'Explanation of when to use DOM and SAX parsers based on the size of the XML file.', 'For huge XML files, the SAX parser is recommended as it reads elements one by one, while for small to medium files, the DOM parser is preferred as it builds the entire tree structure with the XML data.', 'The importance of typing the code is emphasized for better understanding and confidence building.', 'The methods invoked during parsing, including start document, start element, characters, and end element, are explained.', 'The start and end document methods are specifically highlighted as being called when the XML document starts and after reading the entire document, respectively.', 'Typing the code, generating the XML file, and encountering and fixing errors is highlighted as essential for skill development.']}], 'highlights': ['DOM is tree-based, SACS is event-based, with DOM reading entire documents and SACS parsing node by node.', 'The process involves using a factory pattern to obtain a document object, specifically a DOM object, and then creating a new document using b.newDocument.', 'Creating and attaching elements to form the XML structure The process involves creating elements for name, email, mobile, and address, then attaching them to the student element before attaching the student element to the root element.', "The method getElementsByTagName returns a node list of elements with the specified tag name, such as 'staff', resulting in the retrieval of two nodes with IDs 1001 and 2001.", 'The process of parsing XML using DOM involves creating an employee object with details such as ID, first name, last name, nickname, and salary, and then using setter and getter methods to populate the object and store it in a hash map.', 'The chapter emphasizes the significance of calling the end element and end document methods when processing XML files, ensuring proper handling and closure of the XML file.', 'Parsing with SACS parser is event-based, where corresponding methods are called as it reads the XML file.', 'Explanation of when to use DOM and SAX parsers based on the size of the XML file.', 'For huge XML files, the SAX parser is recommended as it reads elements one by one, while for small to medium files, the DOM parser is preferred as it builds the entire tree structure with the XML data.']}