type Pt = 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 Copy(_obj: Pt);override; public // attributes property property Idx read ReadXmlAttrIdx write WriteXmlAttrIdx; function ReadXmlAttrIdx(); function WriteXmlAttrIdx(_value); // pcdata property property V read ReadXmlChildV; function ReadXmlChildV(); public // Attributes XmlAttrIdx: OpenXmlAttribute; // Children XmlChildV: OpenXmlPcdata; end; function Pt.Create();overload; begin {self.}Create(nil, "c", "pt"); end; function Pt.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Pt.Create(_parent: tslobj; _prefix: string; _local_name: string);overload; begin setsysparam(pn_calcctrlword(), getsysparam(pn_calcctrlword()) .| 0x200); class(OpenXmlElement).Create(_parent, _prefix, _local_name); end; function Pt.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "idx": makeweakref(thisFunction(WriteXmlAttrIdx)), ); sorted_child_ := array( pre + "v": array(0, makeweakref(thisFunction(ReadXmlChildV))), ); container_ := new TSOfficeContainer(sorted_child_); end; function Pt.Copy(_obj: Pt);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.Idx) then {self.}Idx := _obj.Idx; if not ifnil(_obj.XmlChildV) then {self.}V.Copy(_obj.XmlChildV); tslassigning := tslassigning_backup; end; function Pt.ReadXmlAttrIdx(); begin return {self.}XmlAttrIdx.Value; end; function Pt.WriteXmlAttrIdx(_value); begin if ifnil({self.}XmlAttrIdx) then begin {self.}XmlAttrIdx := new OpenXmlAttribute("", "idx", nil); attributes_[length(attributes_)] := {self.}XmlAttrIdx; end {self.}XmlAttrIdx.Value := _value; end; function Pt.ReadXmlChildV(); begin if tslassigning and ifnil({self.}XmlChildV) then begin {self.}XmlChildV := new OpenXmlPcdata(self, {self.}Prefix, "v"); container_.Set({self.}XmlChildV); end return {self.}XmlChildV; end;