From the course: XML Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Valid XML documents

Valid XML documents

- [Instructor] In a previous video, I talked a little bit about proper XML syntax, which is needed to make sure that the XML parser is able to properly parse your XML file. But above and beyond that, there's also a concept of what's called a valid XML document. So let's quickly review. Suppose you have an XML parser represented by these gears. So you give it an XML file, and then as long as the syntax is properly formed and you've correctly named your elements and you followed all the rules, then good results come out the other side. And that's what we mean by saying that an XML file is well formed. But there's another way to make sure that XML documents are what's called valid. So you can produce a set of rules that you supply to the parser, and these are applied to the parsing process in addition to the well-formed checks. So for example, you can supply rules that say things like, you know, TAG A is only ever allowed to occur inside TAG B and Attribute X can only have these values…

Contents