摘要 |
Provided is a method and an apparatus to verify an extensible Markup Language (XML) document against a compiled Document Type Definition (DTD). A DTD document can specify valid elements and the sequence of the valid elements in the XML document. During compilation, the elements of the DTD document are added to a structure, such as a tree. Consequently, nodes in the tree can contain elements, which are verified against the elements in the XML document. If there is a match between all the elements in the XML document and elements of the structure, then the XML document is valid. A valid XML document is thus verified and can be processed. Otherwise, an error can result, indicating an invalid XML document.
|