a schema discovery system and associated method discover a majority schema for a set of related and similarly marked up documents , such as html documents , based on the assumption that though the structure of these documents is mostly for visual purposes , the keywords used in the documents along with the structural tags provide some hints , and allow a rough sketch of the underlying intended schema . with the assumption that albeit the set of html documents are marked up differently due to diverse authoring skills , they are closely related in content , it is reasonable to find a schema that can unify these different schemas , which schema is shared by the majority of these html documents . the system employs constraint rules on tree ordering to reduce the computational complexity in arriving at optimized xml dtd schema . these generalized xml dtd schemas may be used to perform automated comparison and evaluation schemes of profile documents on the www .