Difference between parsing a DOM tree and a syntax syntax tree?

After parsing the HTML or XML file, we can get the DOM tree.

After parsing C, C ++ or JavaScript, we can get a syntax tree.

Note that the syntax tree is built on the basis of a context-free grammar that defines a valid C / C ++ / JS program.

But it seems that the DOM tree is just a pure hierarchical structure, indicated only by an HTML / XML file. It's true? Is this the reason the circuit check was done after parsing? What is the fundamental difference between these two types of parsing trees?

+3
source share
2 answers

, XML . XML- ( , , ). , ( ). XML- - , XML.

, , . , .

, XML ().. , "B" "A" .

, C, . if , , . XML , "B" "A" - "A" - "B" -.. , XML .

+1

.

- . :

"" XML " ", " ". (DTD). XML . , , " ".

"" C/++/Java - . , , " ".

PS: , , .

+1

All Articles