Prev | Current Page 394 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

The Flash implementation
should contain an empty PCData node. CData nodes are also ignored.
haXe XML API
The haXe XML API implementation is based on the class Xml located in the default package of the standard
library. The public functions and variables of the class are described in the Tables 8 - 1 through 8 - 3 .
The class also contains a number of static variables describing the existing node types; those variables
are usually used to detect the type of node by comparison and are CData , Comment , DocType , Document ,
Element , PCData , and Prolog .
The Xml.parse() method is to generate an Xml structure from an XML document. The haXe processor
checks if the document is well - formed; the following document is processed correctly:
var xml = Xml.parse(??? < root > < /root > ???);
While the following raises an exception on every platform:
var xml = Xml.parse(??? < root > < /rotten > ???);
Once an XML document is read from an existing source or created new, other nodes can be created using
the corresponding createX() method and then appended to a specific node of the document, the function
addChild() .


Pages:
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406