1
<span class="description">
3
<div class="descriptionheading">Overview</div>
4
This example shows how to do very basic validation of an XML document.
6
<div class="descriptionheading">Well formedness</div>
7
The DOM parser automatically tests for well-formedness when loading the file (row 10).
8
The value that is returned from the <span class="interestingdescription">load</span> method is true if the file was well-formed and false if not.
10
<div class="descriptionheading">Validation</div>
11
Validation of the file using the DTD linked by the XML file (if such a link exists) is performed with the <span class="interestingdescription">validate</span> method.
12
The value returned is true if the file is valid and false if not.
14
Validation is as simple as this in the simplest case. However we do not get very detailed information abou why validation or well-formedness has failed.
16
<div class='exampleheading'>Web Page Output:<br><br>
17
<img src='DomExample2.png'>
b'\\ No newline at end of file'