In haXe these nodes are known as Prolog
and DocType . They can be omitted or just one of the two can be used. If they exist, they must be the first
nodes in the document and respect the given sequence. They are not allowed to have child nodes. A
DocType can define many rules but they are not considered nodes because they must be parsed by a
specific processor.
The Prolog node defines the XML version, usually 1.0, the character encoding, and optionally if
the document may exist as standalone, default value is yes. The node content is wrapped in the
< ?xml ... ? > declaration.
< ?xml version=???1.0??? encoding=???UTF-8???? >
The DocType node defines the rules for the validation check of the document. The DTD rules can be
expressed inline or referenced in an external document as in the example.
The content of a DocType node is wrapped in the < !DOCTYPE ... > declaration.
< !DOCTYPE html
PUBLIC ???-//W3C//DTD XHTML 1.0 Strict//EN???
???http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd??? >
What is usually underestimated in XML parsing is that whitespaces, and more generally the characters
between tags, are nodes on their own.
Pages:
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402