diff --git a/gxml/GomElement.vala b/gxml/GomElement.vala index 96f6f2862a8fbc0bcafce1f88e2fdbdae2d50eaf..7f7de8f725c1aa6109f35c10f62b9eaaaa025e5a 100644 --- a/gxml/GomElement.vala +++ b/gxml/GomElement.vala @@ -298,10 +298,8 @@ public class GXml.GomElement : GomNode, /** * An attribute called 'id'. */ - public string? id { - owned get { return (this as GomElement).get_attribute ("id"); } - set { (this as GomObject).set_attribute ("id", value); } - } + [Description (nick="::id")] + public string? id { owned get; set; } /** * An attribute called 'class'. */ diff --git a/test/GomElementTest.vala b/test/GomElementTest.vala index d2999af2875046c1af5a695a282346c83345a94d..a231741a97da8e298002ee4dde9687cdee9f8f65 100644 --- a/test/GomElementTest.vala +++ b/test/GomElementTest.vala @@ -164,6 +164,9 @@ class GomElementTest : GXmlTest { assert (elem.get_attribute_ns ("http://www.gnome.org/GXml", "xola") == null); assert (elem.get_attribute ("xola") == null); assert (elem.attributes.size == 2); + elem.id = "idnode"; + assert ("id=\"idnode\"" in elem.write_string ()); + assert (elem.id == "idnode"); try { #if DEBUG message ("Documento:"+parser.write_string ());