Prev | Current Page 402 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


class Main
{
public static function main()
{
var doc = Xml.createDocument();
#if (flash9 || js || neko)
doc.addChild(Xml.createProlog(??? < ?xml version=???1.0???? > ??™));
(continued)
Part II: Server Side, JavaScript, and Flash; Oh My!
210
#end
var root = Xml.createElement(???people???);
doc.addChild(root);
var p = Xml.createElement(???person???);
root.addChild(p);
p.set(???name???, ???John Doe???);
p.addChild(Xml.createPCData(???Biography goes here ...???));
trace(doc.toString());
}
}
Regular Expression
A regular expression is a text pattern used to describe or match a set of strings. The EReg class provides a
cross - platform implementation of this feature. Regular expressions are not supported on Flash versions
older than 9. On the supported platforms, the EReg class acts as a wrapper to the native implementations
(Neko uses the PCRE library). A regular expression is performed to find a correspondence inside a
string; if the correspondence exists, it is said that a match has been found.


Pages:
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414