Prev | Current Page 398 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

If the child node is not
contained in the current node, nothing happens. This function only
works if the current node is of type Element.
set(att:String,
value:String) : Void
Sets the value of an attribute; the first argument is the attribute name
and the second is the attribute value.
toString() : String Transforms the current node in a XML string representation.
Part II: Server Side, JavaScript, and Flash; Oh My!
208
A common mistake is to iterate over the nodes using the iterator() function expecting a sequence of
nodes only of the Element type; the iterator() function, as the firstChild() , returns the full list of
all the child nodes that include nodes of type Prolog , DocType , PCData , CData , and Comment . To
retrieve only the node of Element type use elements() and firstElement() respectively.
All variables in the XML class use method accessors (getters and setters) to handle their values. This
technique has been adopted to overcome the differences between the native XML API implementations.


Pages:
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410