ElementTree.hx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package python.lib.xml.etree;
  2. import python.lib.Types.Tup2;
  3. import python.lib.Types;
  4. extern class XMLParser {
  5. }
  6. extern class Element {
  7. public function getroot ():ElementTree;
  8. public var tag:String;
  9. public var attrib : Dict<String, String>;
  10. public var text:Null<String>;
  11. public function get <T>(key:String, def:T = null):T;
  12. public function set (key:String, val:String):Void;
  13. public function copy ():Element;
  14. public function keys ():Array<String>;
  15. public function items ():Array<Tup2<String, String>>;
  16. public function iter (tag:String):PyIterable<Element>;
  17. public function iterfind (tag:String, namespaces:Dict<String,String> = null):PyIterator<Element>;
  18. public function find (match:String, namespaces:Dict<String,String> = null):Null<Element>;
  19. public function findall (match:String, namespaces:Dict<String,String> = null):Array<Element>;
  20. static function __init__ ():Void
  21. {
  22. Syntax.importFromAs("xml.etree.ElementTree", "Element", "python.lib.xml.etree.Element");
  23. }
  24. }
  25. extern class ElementTree {
  26. public static function XML(text:String, ?parser:XMLParser):Element;
  27. public static function parse(xml:String):ElementTree;
  28. public function iter (tag:String):PyIterable<Element>;
  29. public function find (match:String, namespaces:Dict<String,String> = null):Null<Element>;
  30. public function getroot ():Element;
  31. static function __init__ ():Void
  32. {
  33. Syntax.importAs("xml.etree.ElementTree", "python.lib.xml.etree.ElementTree");
  34. }
  35. }