Ver código fonte

added parent.

Nicolas Cannasse 19 anos atrás
pai
commit
01d55b75a0
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      std/Xml.hx

+ 4 - 1
std/Xml.hx

@@ -75,12 +75,15 @@ extern class Xml {
 	function attributes() : Iterator<String>;
 
 	// children method : only works for Node and Document
-	// exception if child is Document (can't add Documents together)
+	var parent(getParent,null) : Xml;
+	private function getParent() : Xml;
+
 	function iterator() : Iterator<Xml>;
 	function elements() : Iterator<Xml>;
 	function elementsNamed( name : String ) : Iterator<Xml>; // only nodes with this nodeName
 	function firstChild() : Xml;
 	function firstElement() : Xml;
+	// exception if child is Document (can't add Documents together)
 	function addChild( x : Xml ) : Void;
 	function removeChild( x : Xml ) : Bool;
 	function insertChild( x : Xml, pos : Int ) : Void;