Testing our sample
The following is a sample main
function if you want to try this code. It may also help you to understand how to use it:
public static function main(): Void { trace('Hello World'); trace(Page.fromXMLFile("/Users/benjamin/example.xml")); trace(Page.fromXMLFile("/Users/benjamin/example.xml")); var p = new Page(); p.name = "Page de test"; var l1 = new Layer(); l1.id="l1"; var l2 = new Layer(); l2.id="l2"; p.layers.add(l1); p.layers.add(l2); p.toXMLFile("/Users/benjamin/page1.xml"); }