I have been on the hunt for a good XML course for a couple of years now and have piloted a few different XML online training courses. It has been quite a search, as I discovered various issues with the courses I had tried. A couple of them, for example, glossed over how to set up a proper development environment, so I didn’t feel I could recommend them, even when the rest of the content was good. Others failed to explain the difference between HTML and XML well, so I didn’t feel there was enough of a reference point for entering the course material.
After several tries, I am happy to report that I finally found an XML course that I am comfortable recommending. XML and XML Schema Definition in Easy Steps starts with an introduction to XML and shows you how to create your first XML documents and the schema against which you will define your documents. It also goes into detail of how to build XML parsers in Java.
If this terminology is unfamiliar, you do not need to worry because these concepts are covered in detail in the course.
What Is XML?
XML stands for Extensible Markup language. It is similar to HTML in that they are both markup languages that make use of tags. There are some major differences, however, between these markup languages.
For starters, the function of HTML is to provide structure to data. As you develop your websites, you markup your content with HTML tags so that the browser knows whether it’s displaying a header, paragraph, image, list, etc. This is the sole purpose of HTML.
The function of XML is to store and transmit data. It allows different systems to share the same data, even if the data is formatted differently within each system. XML strips all of the formatting away and stores the data in plain text formats. This is how XML can transmit data to any system.
Another difference is that XML tags are not predefined. If you are a web developer, who works with XML, you will define your own tags. HTML tags are predefined. We can look them up in reference sources, and they will not work properly if we get the tags wrong as we add them to our content.
Like HTML, XML also has elements and attributes. Elements define and separate the different sections of an XML document, and both markup languages require opening and closing tags. Attributes, which are optional, can provide more information about an element. In this respect, XML also functions similarly to HTML. Unlike HTML, XML is case-sensitive.
While some developers have started using JSON as an alternative to XML, at the university where I work, we use XML in our online forms, which are written in PHP. XML allows us to transfer the data from the forms easily among multiple applications and interfaces.
Who Should Take This Course?
While this is not a course for beginners, anyone who has a familiarity with HTML can at least follow along. In order to receive the full benefit of the course, however, knowledge of some HTML is essential, and prior experience with Java programming is helpful as well. In the latter parts of the course, the instructor demonstrates how to build various XML parsers in Java and validate a drivers’ license use case, which you’ll learn how to build in the beginning of the course.
What the Course Covers
This particular course starts out with showing you how to install Eclipse, an integrated development environment (also known as an IDE). Normally Eclipse is used for Java, C, and C++ development, though it also has support for XML. One of the courses I piloted did not give a walk-through of how to download and install the IDE the instructor recommended, and his recommendation only worked for PC’s. While students could certainly do some research to find an IDE for XML that would work for Macs, this cuts into the time you have to create the setup you need to get started with the course. When piloting courses, I always look for instructors that give detailed walk-throughs of installation and setup, and Bharath Thippireddy, the course author, does so in XML and XML Schema Definition in Easy Steps.
Introduction to XML Concepts and XML Application
The course starts out by explaining what XML is, how it is used, and how XML is parsed. Even though we write our own XML tags, or as Thippireddy says, “we define our own markup”, there are a number of rules that we must follow as web developers so that different systems can understand the data that we are transmitting. In the course, you will learn about the syntax rules so that you can apply them to your work. In this section, an example of how XML works for a company like Amazon is included.
After providing an introduction to XML, the next section demonstrates a walk-through on how to build an XML file from scratch. Because Eclipse is a robust IDE with a number of options for setting up a project, it takes some time to learn how to navigate through the set up of your first XML document. If you follow the instructions Thippireddy provides, though, you will be able to set your document up properly.
One thing I will mention is that an XML project has two different screen views: Design and Source. You will want to make sure you are on the Source view as you follow along and populate the file.
Before getting into the meat of populating the XML file with a Driver License use case, Thippireddy takes the time to explain the encoding and standalone attributes. Assuming you are familiar with HTML, you are likely familiar with UTF-8 encoding. The standalone attribute can have a value of either “yes” or “no”, depending on when the XML document you’re building can stand on its own or is reliant on external documents, such as XML Schema. The next videos demonstrate how to populate the XML document, as well as explanations of parent / child elements, how comments work, and a set of rules and best practices. The section ends with a quiz and a small assignment to help you determine if you’re ready to move on to the next section.
The course spends a couple of sections on XML schema, which is a set of rules that we, as developers, need to follow in order to create valid XML documents that will work properly. The World-Wide Web Consortium, or W3C for short, defines the elements that we can use in a schema file. XML schema types include:
- Inbuilt Types, as specified by the W3C. These include things link integers, strings, decimals, etc.
- Simple Types, which extend inbuilt types, such as restricting all strings to 20 characters.
- Complex Types, which are elements that can have nested elements.
After explaining what XML schema is and how it is used, Thippireddy demonstrates who to create a schema document with an .xsd extension. In a schema file, we define our own XML rules against which our XML document is parsed. During the walk-through, you will probably be a little confused if you’ve never defined a schema before, but the next three sections on creating simple and complex types as well as attribute types help fill in the gaps. As you work your way through these sections, referring to the XML Schema Reference from W3Schools will be helpful. By the end of those three sections, you will have a solid understanding of how to write your own XML schema.
The course goes into detail about the three different types of API parsers and when to use them. Thippireddy also shows you how to create each parser in Java.
- DOM (Document Object Model) Parser – We use the DOM parser when we need to access the different parts of the XML in our application at the same time. This parser doesn’t work particularly well if you have memory issues because it loads the entire XML document into memory, allowing you to access any part of the document.
- SAX (Simple API for XML Parsing) Parser – The SAX parser is an API that is event-driven, meaning it fires off events as it parses the document, communicating back to us the details of what it finds so that we can make adjustments. The SAX Parser does not use much memory because it forgets about the events as soon as it fires them off. This parser is read-only, meaning we cannot use it to create XML documents.
- STAX (Streaming API for XML Parsing) Parser – STAX is called a “pull-based parser.” It allows us more flexibility and control by allowing us to specify which parts of the XML document we want it to read as it does not load the entire document into memory. This process requires less memory than the DOM Parser. This parser does not support schema validation, so if you use a STAX parser, you will have to validate your XML document against the schema separately. This isn’t too difficult to do, since the Eclipse IDE alerts you any time there is an error and reads your XML document against the schema in real time.
In these three sections on parsers, Thippireddy shows you use the different parsers to read the Driver License use case and convert it into a Java object. A background with Java is helpful for this part of the course, but if you don’t know Java, you can follow along regardless.
A Few Things to Be Aware of Before You Purchase This Course
A Couple of Small Drawbacks
Personally, at times, I found the instructor a little difficult to understand. Udemy, though, offers English subtitles, and once I turned those on, I was able to follow along. Even with an occasional language barrier, this is still the best course on XML that I have found after piloting several courses. One of the other issues I encountered was inconsistency in the sound level. I really appreciate that the instructor recorded some of the videos facing the camera, but the volume level was too low in comparison with the other videos. It wasn’t a huge deal but something you should be aware of.
Small, Digestible Lectures
Nearly all of the lectures (with some exceptions) are under four minutes, and I really appreciate the instructor creating a course structure of short videos. Throughout the course, I felt like I was making rapid progress, which gave me the fortitude to keep going, and I ended up piloting the course in a single day, while following along with the exercises.
While I have yet to find the perfect course for XML online training, XML and XML Schema Definition in Easy Steps come fairly close.
I hope you enjoyed reading this review. If you have further questions about the course or the projects I created, please feel free to contact me at firstname.lastname@example.org or through leaving a comment below.