type CompatSetting = class(OpenXmlElement) public function Create();overload; function Create(_node: XmlNode);overload; function Create(_parent: tslobj; _prefix: string; _local_name: string);overload; function Init();override; function InitAttributes();override; function InitChildren();override; function InitNode(_node: XmlNode);override; function Copy(_obj: CompatSetting);override; property Name read ReadXmlAttrName write WriteXmlAttrName; property Uri read ReadXmlAttrUri write WriteXmlAttrUri; property Val read ReadXmlAttrVal write WriteXmlAttrVal; function ReadXmlAttrName(); function WriteXmlAttrName(_value); function ReadXmlAttrUri(); function WriteXmlAttrUri(_value); function ReadXmlAttrVal(); function WriteXmlAttrVal(_value); public // Attributes XmlAttrName: OpenXmlAttribute; XmlAttrUri: OpenXmlAttribute; XmlAttrVal: OpenXmlAttribute; // Children end; function CompatSetting.Create();overload; begin self.Create(nil, "w", "compatSetting"); end; function CompatSetting.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function CompatSetting.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; begin class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function CompatSetting.Init();override; begin self.XmlAttrName := new OpenXmlAttribute(self.Prefix, "name", nil); self.XmlAttrUri := new OpenXmlAttribute(self.Prefix, "uri", nil); self.XmlAttrVal := new OpenXmlAttribute(self.Prefix, "val", nil); end; function CompatSetting.InitAttributes();override; begin attributes_ := array( self.XmlAttrName, self.XmlAttrUri, self.XmlAttrVal, ); end; function CompatSetting.InitChildren();override; begin child_elements_ := array( ); sorted_child_ := array( "": -1, ); end; function CompatSetting.InitNode(_node: XmlNode);override; begin if ifObj(self.XmlNode) then for k,v in child_elements_ do v.InitNode(nil); self.XmlNode := ifObj(_node) ? _node : nil; end; function CompatSetting.Copy(_obj: CompatSetting);override; begin if not ifnil(_obj.XmlAttrName.Value) then self.XmlAttrName.Value := _obj.XmlAttrName.Value; if not ifnil(_obj.XmlAttrUri.Value) then self.XmlAttrUri.Value := _obj.XmlAttrUri.Value; if not ifnil(_obj.XmlAttrVal.Value) then self.XmlAttrVal.Value := _obj.XmlAttrVal.Value; end; function CompatSetting.ReadXmlAttrName(); begin return self.XmlAttrName.Value; end; function CompatSetting.WriteXmlAttrName(_value); begin self.XmlAttrName.Value := _value; end; function CompatSetting.ReadXmlAttrUri(); begin return self.XmlAttrUri.Value; end; function CompatSetting.WriteXmlAttrUri(_value); begin self.XmlAttrUri.Value := _value; end; function CompatSetting.ReadXmlAttrVal(); begin return self.XmlAttrVal.Value; end; function CompatSetting.WriteXmlAttrVal(_value); begin self.XmlAttrVal.Value := _value; end;