The invention provides an
XML (extensive markup language) file
visual comparison method and device and
electronic equipment, and relates to the field of electronic manual comparison, the method comprises the following steps: determining similar nodes by using a similarity check method, traversing DOM (
document object model) trees of a first Document object and a second Document object,
processing all similar nodes by using node IDs (identity) as anchor points, determining matched nodes, and comparing the matched nodes with the first Document object and the second Document object; each piece of initial difference information corresponding to each matching node is recorded, all Diff objects are constructed and returned, each piece of detailed difference information is obtained, and all the detailed difference information is added to attribute difference mapping of the XmlDiff objects; and analyzing the file tag and the
file attribute analyzed by the XSD rule by using a preset
data standard, compiling an
XSLT style sheet, loading a style file according to attribute difference mapping and the
XSLT style sheet, and displaying the first
HTML file and the second
HTML file on a preset display interface. According to the method, the
XML file to be compared can be automatically obtained and converted into the
stream file form to be analyzed and compared, so that the comparison efficiency and accuracy are greatly improved.