haXe API Documentation
Back | Index
class haxe.xml.Proxy<Const, T>
Available in flash, neko, js, flash9, php, cpp

This proxy can be inherited with an XML file name parameter. It will only allow access to fields which corresponds to an "id" attribute value in the XML file :

    class MyXml extends haxe.xml.Proxy<"my.xml",MyStructure> {
    }
    ...
    var h = new Hash<MyStructure>();
    // ... fill h with "my.xml" content
    var m = new MyXml(h.get);
    trace(m.myNode.structField);
    // access to "myNode" is only possible
    // if you have an id="myNode" attribute
    // in your XML, and completion works as well
    

function new(f : String -> T) : Void
function resolve(k : String) : T
Back | Index