type Document = 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: Document);override; public // attributes property property XmlnsWpc read ReadXmlAttrXmlnsWpc write WriteXmlAttrXmlnsWpc; property XmlnsW15 read ReadXmlAttrXmlnsW15 write WriteXmlAttrXmlnsW15; property XmlnsW16Cex read ReadXmlAttrXmlnsW16Cex write WriteXmlAttrXmlnsW16Cex; property XmlnsW16Cid read ReadXmlAttrXmlnsW16Cid write WriteXmlAttrXmlnsW16Cid; property XmlnsW16 read ReadXmlAttrXmlnsW16 write WriteXmlAttrXmlnsW16; property XmlnsW16Du read ReadXmlAttrXmlnsW16Du write WriteXmlAttrXmlnsW16Du; property XmlnsW16sdtdh read ReadXmlAttrXmlnsW16sdtdh write WriteXmlAttrXmlnsW16sdtdh; property XmlnsW16se read ReadXmlAttrXmlnsW16se write WriteXmlAttrXmlnsW16se; property XmlnsWpg read ReadXmlAttrXmlnsWpg write WriteXmlAttrXmlnsWpg; property XmlnsWpi read ReadXmlAttrXmlnsWpi write WriteXmlAttrXmlnsWpi; property XmlnsWne read ReadXmlAttrXmlnsWne write WriteXmlAttrXmlnsWne; property XmlnsWps read ReadXmlAttrXmlnsWps write WriteXmlAttrXmlnsWps; property McIgnorable read ReadXmlAttrMcIgnorable write WriteXmlAttrMcIgnorable; function ReadXmlAttrXmlnsWpc(); function WriteXmlAttrXmlnsWpc(_value); function ReadXmlAttrXmlnsW15(); function WriteXmlAttrXmlnsW15(_value); function ReadXmlAttrXmlnsW16Cex(); function WriteXmlAttrXmlnsW16Cex(_value); function ReadXmlAttrXmlnsW16Cid(); function WriteXmlAttrXmlnsW16Cid(_value); function ReadXmlAttrXmlnsW16(); function WriteXmlAttrXmlnsW16(_value); function ReadXmlAttrXmlnsW16Du(); function WriteXmlAttrXmlnsW16Du(_value); function ReadXmlAttrXmlnsW16sdtdh(); function WriteXmlAttrXmlnsW16sdtdh(_value); function ReadXmlAttrXmlnsW16se(); function WriteXmlAttrXmlnsW16se(_value); function ReadXmlAttrXmlnsWpg(); function WriteXmlAttrXmlnsWpg(_value); function ReadXmlAttrXmlnsWpi(); function WriteXmlAttrXmlnsWpi(_value); function ReadXmlAttrXmlnsWne(); function WriteXmlAttrXmlnsWne(_value); function ReadXmlAttrXmlnsWps(); function WriteXmlAttrXmlnsWps(_value); function ReadXmlAttrMcIgnorable(); function WriteXmlAttrMcIgnorable(_value); // normal property property Body read ReadXmlChildBody; function ReadXmlChildBody(); public // Attributes XmlAttrXmlnsWpc: OpenXmlAttribute; XmlAttrXmlnsW15: OpenXmlAttribute; XmlAttrXmlnsW16Cex: OpenXmlAttribute; XmlAttrXmlnsW16Cid: OpenXmlAttribute; XmlAttrXmlnsW16: OpenXmlAttribute; XmlAttrXmlnsW16Du: OpenXmlAttribute; XmlAttrXmlnsW16sdtdh: OpenXmlAttribute; XmlAttrXmlnsW16se: OpenXmlAttribute; XmlAttrXmlnsWpg: OpenXmlAttribute; XmlAttrXmlnsWpi: OpenXmlAttribute; XmlAttrXmlnsWne: OpenXmlAttribute; XmlAttrXmlnsWps: OpenXmlAttribute; XmlAttrMcIgnorable: OpenXmlAttribute; // Children XmlChildBody: Body; end; function Document.Create();overload; begin {self.}Create(nil, "w", "document"); end; function Document.Create(_node: XmlNode);overload; begin class(OpenXmlElement).Create(_node: XmlNode); end; function Document.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 Document.Init();override; begin pre := {self.}Prefix ? {self.}Prefix + ":" : ""; attributes_ := array(); attributes_pf_ := array( "xmlns:wpc": makeweakref(thisFunction(WriteXmlAttrXmlnsWpc)), "xmlns:w15": makeweakref(thisFunction(WriteXmlAttrXmlnsW15)), "xmlns:w16cex": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Cex)), "xmlns:w16cid": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Cid)), "xmlns:w16": makeweakref(thisFunction(WriteXmlAttrXmlnsW16)), "xmlns:w16du": makeweakref(thisFunction(WriteXmlAttrXmlnsW16Du)), "xmlns:w16sdtdh": makeweakref(thisFunction(WriteXmlAttrXmlnsW16sdtdh)), "xmlns:w16se": makeweakref(thisFunction(WriteXmlAttrXmlnsW16se)), "xmlns:wpg": makeweakref(thisFunction(WriteXmlAttrXmlnsWpg)), "xmlns:wpi": makeweakref(thisFunction(WriteXmlAttrXmlnsWpi)), "xmlns:wne": makeweakref(thisFunction(WriteXmlAttrXmlnsWne)), "xmlns:wps": makeweakref(thisFunction(WriteXmlAttrXmlnsWps)), "mc:Ignorable": makeweakref(thisFunction(WriteXmlAttrMcIgnorable)), ); sorted_child_ := array( pre + "body": array(0, makeweakref(thisFunction(ReadXmlChildBody))), ); container_ := new TSOfficeContainer(sorted_child_); end; function Document.Copy(_obj: Document);override; begin tslassigning_backup := tslassigning; tslassigning := 1; class(OpenXmlElement).Copy(_obj); if not ifnil(_obj.XmlnsWpc) then {self.}XmlnsWpc := _obj.XmlnsWpc; if not ifnil(_obj.XmlnsW15) then {self.}XmlnsW15 := _obj.XmlnsW15; if not ifnil(_obj.XmlnsW16Cex) then {self.}XmlnsW16Cex := _obj.XmlnsW16Cex; if not ifnil(_obj.XmlnsW16Cid) then {self.}XmlnsW16Cid := _obj.XmlnsW16Cid; if not ifnil(_obj.XmlnsW16) then {self.}XmlnsW16 := _obj.XmlnsW16; if not ifnil(_obj.XmlnsW16Du) then {self.}XmlnsW16Du := _obj.XmlnsW16Du; if not ifnil(_obj.XmlnsW16sdtdh) then {self.}XmlnsW16sdtdh := _obj.XmlnsW16sdtdh; if not ifnil(_obj.XmlnsW16se) then {self.}XmlnsW16se := _obj.XmlnsW16se; if not ifnil(_obj.XmlnsWpg) then {self.}XmlnsWpg := _obj.XmlnsWpg; if not ifnil(_obj.XmlnsWpi) then {self.}XmlnsWpi := _obj.XmlnsWpi; if not ifnil(_obj.XmlnsWne) then {self.}XmlnsWne := _obj.XmlnsWne; if not ifnil(_obj.XmlnsWps) then {self.}XmlnsWps := _obj.XmlnsWps; if not ifnil(_obj.McIgnorable) then {self.}McIgnorable := _obj.McIgnorable; if not ifnil(_obj.XmlChildBody) then {self.}Body.Copy(_obj.XmlChildBody); tslassigning := tslassigning_backup; end; function Document.ReadXmlAttrXmlnsWpc(); begin return {self.}XmlAttrXmlnsWpc.Value; end; function Document.WriteXmlAttrXmlnsWpc(_value); begin if ifnil({self.}XmlAttrXmlnsWpc) then begin {self.}XmlAttrXmlnsWpc := new OpenXmlAttribute("xmlns", "wpc", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsWpc; end {self.}XmlAttrXmlnsWpc.Value := _value; end; function Document.ReadXmlAttrXmlnsW15(); begin return {self.}XmlAttrXmlnsW15.Value; end; function Document.WriteXmlAttrXmlnsW15(_value); begin if ifnil({self.}XmlAttrXmlnsW15) then begin {self.}XmlAttrXmlnsW15 := new OpenXmlAttribute("xmlns", "w15", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW15; end {self.}XmlAttrXmlnsW15.Value := _value; end; function Document.ReadXmlAttrXmlnsW16Cex(); begin return {self.}XmlAttrXmlnsW16Cex.Value; end; function Document.WriteXmlAttrXmlnsW16Cex(_value); begin if ifnil({self.}XmlAttrXmlnsW16Cex) then begin {self.}XmlAttrXmlnsW16Cex := new OpenXmlAttribute("xmlns", "w16cex", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Cex; end {self.}XmlAttrXmlnsW16Cex.Value := _value; end; function Document.ReadXmlAttrXmlnsW16Cid(); begin return {self.}XmlAttrXmlnsW16Cid.Value; end; function Document.WriteXmlAttrXmlnsW16Cid(_value); begin if ifnil({self.}XmlAttrXmlnsW16Cid) then begin {self.}XmlAttrXmlnsW16Cid := new OpenXmlAttribute("xmlns", "w16cid", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Cid; end {self.}XmlAttrXmlnsW16Cid.Value := _value; end; function Document.ReadXmlAttrXmlnsW16(); begin return {self.}XmlAttrXmlnsW16.Value; end; function Document.WriteXmlAttrXmlnsW16(_value); begin if ifnil({self.}XmlAttrXmlnsW16) then begin {self.}XmlAttrXmlnsW16 := new OpenXmlAttribute("xmlns", "w16", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16; end {self.}XmlAttrXmlnsW16.Value := _value; end; function Document.ReadXmlAttrXmlnsW16Du(); begin return {self.}XmlAttrXmlnsW16Du.Value; end; function Document.WriteXmlAttrXmlnsW16Du(_value); begin if ifnil({self.}XmlAttrXmlnsW16Du) then begin {self.}XmlAttrXmlnsW16Du := new OpenXmlAttribute("xmlns", "w16du", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16Du; end {self.}XmlAttrXmlnsW16Du.Value := _value; end; function Document.ReadXmlAttrXmlnsW16sdtdh(); begin return {self.}XmlAttrXmlnsW16sdtdh.Value; end; function Document.WriteXmlAttrXmlnsW16sdtdh(_value); begin if ifnil({self.}XmlAttrXmlnsW16sdtdh) then begin {self.}XmlAttrXmlnsW16sdtdh := new OpenXmlAttribute("xmlns", "w16sdtdh", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16sdtdh; end {self.}XmlAttrXmlnsW16sdtdh.Value := _value; end; function Document.ReadXmlAttrXmlnsW16se(); begin return {self.}XmlAttrXmlnsW16se.Value; end; function Document.WriteXmlAttrXmlnsW16se(_value); begin if ifnil({self.}XmlAttrXmlnsW16se) then begin {self.}XmlAttrXmlnsW16se := new OpenXmlAttribute("xmlns", "w16se", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsW16se; end {self.}XmlAttrXmlnsW16se.Value := _value; end; function Document.ReadXmlAttrXmlnsWpg(); begin return {self.}XmlAttrXmlnsWpg.Value; end; function Document.WriteXmlAttrXmlnsWpg(_value); begin if ifnil({self.}XmlAttrXmlnsWpg) then begin {self.}XmlAttrXmlnsWpg := new OpenXmlAttribute("xmlns", "wpg", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsWpg; end {self.}XmlAttrXmlnsWpg.Value := _value; end; function Document.ReadXmlAttrXmlnsWpi(); begin return {self.}XmlAttrXmlnsWpi.Value; end; function Document.WriteXmlAttrXmlnsWpi(_value); begin if ifnil({self.}XmlAttrXmlnsWpi) then begin {self.}XmlAttrXmlnsWpi := new OpenXmlAttribute("xmlns", "wpi", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsWpi; end {self.}XmlAttrXmlnsWpi.Value := _value; end; function Document.ReadXmlAttrXmlnsWne(); begin return {self.}XmlAttrXmlnsWne.Value; end; function Document.WriteXmlAttrXmlnsWne(_value); begin if ifnil({self.}XmlAttrXmlnsWne) then begin {self.}XmlAttrXmlnsWne := new OpenXmlAttribute("xmlns", "wne", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsWne; end {self.}XmlAttrXmlnsWne.Value := _value; end; function Document.ReadXmlAttrXmlnsWps(); begin return {self.}XmlAttrXmlnsWps.Value; end; function Document.WriteXmlAttrXmlnsWps(_value); begin if ifnil({self.}XmlAttrXmlnsWps) then begin {self.}XmlAttrXmlnsWps := new OpenXmlAttribute("xmlns", "wps", nil); attributes_[length(attributes_)] := {self.}XmlAttrXmlnsWps; end {self.}XmlAttrXmlnsWps.Value := _value; end; function Document.ReadXmlAttrMcIgnorable(); begin return {self.}XmlAttrMcIgnorable.Value; end; function Document.WriteXmlAttrMcIgnorable(_value); begin if ifnil({self.}XmlAttrMcIgnorable) then begin {self.}XmlAttrMcIgnorable := new OpenXmlAttribute("mc", "Ignorable", nil); attributes_[length(attributes_)] := {self.}XmlAttrMcIgnorable; end {self.}XmlAttrMcIgnorable.Value := _value; end; function Document.ReadXmlChildBody(); begin if tslassigning and ifnil({self.}XmlChildBody) then begin {self.}XmlChildBody := new Body(self, {self.}Prefix, "body"); container_.Set({self.}XmlChildBody); end return {self.}XmlChildBody; end;