From 04f4e2acfbc82946ca3def654214c08071a87359 Mon Sep 17 00:00:00 2001
From: George Hazan <george.hazan@gmail.com>
Date: Sat, 20 Jun 2015 13:55:58 +0000
Subject: xml api became a set of functions

git-svn-id: http://svn.miranda-ng.org/main/trunk@14288 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
---
 plugins/Actman/iac_chain.pas      |  27 +--
 plugins/Actman/iac_contact.pas    |  29 +--
 plugins/Actman/iac_dbrw.pas       |  89 +++------
 plugins/Actman/iac_global.pas     |  71 +++----
 plugins/Actman/iac_inout.pas      |  50 +++--
 plugins/Actman/iac_jump.pas       | 122 ++++--------
 plugins/Actman/iac_messagebox.pas |  23 +--
 plugins/Actman/iac_program.pas    |  37 ++--
 plugins/Actman/iac_service.pas    | 109 ++++-------
 plugins/Actman/iac_storage.pas    |   9 +-
 plugins/Actman/iac_text.pas       |  18 +-
 plugins/Actman/inoutxml.pas       | 134 ++++++-------
 plugins/Actman/ua/i_inoutjson.inc |   2 +-
 plugins/Actman/ua/i_inoutxm.inc   | 389 ++++++++++++++++++--------------------
 14 files changed, 432 insertions(+), 677 deletions(-)

(limited to 'plugins/Actman')

diff --git a/plugins/Actman/iac_chain.pas b/plugins/Actman/iac_chain.pas
index 48b187259f..5be20d6d8c 100644
--- a/plugins/Actman/iac_chain.pas
+++ b/plugins/Actman/iac_chain.pas
@@ -141,37 +141,18 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        StrDupW(actname,getText(HXML(node)));
-        flags:=flags or ACF_BYNAME;
-
-        if StrToInt(getAttrValue(HXML(node),ioNoWait))=1 then
-          flags:=flags or ACF_NOWAIT;
-
-        if StrToInt(getAttrValue(HXML(node),ioKeepOld))=1 then
-          flags:=flags or ACF_KEEPOLD;
-
-        if StrToInt(getAttrValue(HXML(node),ioSameThread))=1 then
-          flags:=flags or ACF_SAMETHREAD;
-      end;
-    end;
-{
-    2: begin
-
-      UF8ToWide(GetParamSectionStr(node,'name',nil),actname);
+      StrDupW(actname,xmlGetText(HXML(node)));
       flags:=flags or ACF_BYNAME;
 
-      if GetParamSectionInt(node,ioNoWait)=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioNoWait))=1 then
         flags:=flags or ACF_NOWAIT;
 
-      if GetParamSectionInt(node,ioKeepOld)=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioKeepOld))=1 then
         flags:=flags or ACF_KEEPOLD;
 
-      if GetParamSectionInt(node,ioSameThread)=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioSameThread))=1 then
         flags:=flags or ACF_SAMETHREAD;
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/iac_contact.pas b/plugins/Actman/iac_contact.pas
index 7c17334f15..561c8840fa 100644
--- a/plugins/Actman/iac_contact.pas
+++ b/plugins/Actman/iac_contact.pas
@@ -84,25 +84,12 @@ begin
       contact:=LoadContact(DBBranch,node);
 
     1: begin
-      with xmlparser do
-      begin
-        contact:=ImportContact(HXML(node));
-        if StrToInt(getAttrValue(HXML(node),ioKeepOnly))=1 then
-          flags:=flags or ACF_KEEPONLY;
-        if StrToInt(getAttrValue(HXML(node),ioWindow))=1 then
-          flags:=flags or ACF_GETACTIVE;
-      end;
-    end;
-{
-    2: begin
-      contact:=ImportContactINI(node);
-
-      if GetParamSectionInt(node,ioKeepOnly)=1 then
+      contact:=ImportContact(HXML(node));
+      if StrToInt(xmlGetAttrValue(HXML(node),ioKeepOnly))=1 then
         flags:=flags or ACF_KEEPONLY;
-      if GetParamSectionInt(node,ioWindow)=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioWindow))=1 then
         flags:=flags or ACF_GETACTIVE;
     end;
-}
   end;
 end;
 
@@ -112,7 +99,6 @@ var
   cws:TDBVARIANT;
   p1:pAnsiChar;
   p:pWideChar;
-//  tmpbuf:array [0..63] of WideChar;
   is_chat:boolean;
 begin
   result:=0;
@@ -168,14 +154,7 @@ begin
   case fmt of
     0: if (flags and ACF_GETACTIVE)=0 then
       SaveContact(contact,DBBranch,node);
-{
-    1: begin
-        sub:=AddChild(actnode,ioContactWindow,nil);
-        ExportContact(sub,contact);
-//        AddAttrInt(sub,ioNumber,0); // contact
-        if (flags and ACF_KEEPONLY)<>0 then AddAttrInt(sub,ioKeepOnly,1);
-    end;
-}
+
     13: begin
       tTextExport(node).AddFlag('keeponly' ,(flags or ACF_KEEPONLY )<>0);
       tTextExport(node).AddFlag('getactive',(flags or ACF_GETACTIVE)<>0);
diff --git a/plugins/Actman/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas
index f9faa18293..dffd5ca233 100644
--- a/plugins/Actman/iac_dbrw.pas
+++ b/plugins/Actman/iac_dbrw.pas
@@ -389,79 +389,40 @@ begin
     end;
 
     1: begin
-      with xmlparser do
+      tmp:=xmlGetAttrValue(HXML(node),ioOper);
+      if      lstrcmpiw(tmp,ioDelete)=0 then flags:=flags or ACF_DBDELETE
+      else if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
+      tmp:=xmlGetAttrValue(HXML(node),ioContact);
+      if      lstrcmpiw(tmp,ioCurrent)=0 then flags:=flags or ACF_CURRENT
+      else if lstrcmpiw(tmp,ioResult )=0 then flags:=flags or ACF_RESULT
+      else if lstrcmpiw(tmp,ioParam  )=0 then flags:=flags or ACF_PARAM
+      else if lstrcmpiw(tmp,ioContact)=0 then
       begin
-        tmp:=getAttrValue(HXML(node),ioOper);
-        if      lstrcmpiw(tmp,ioDelete)=0 then flags:=flags or ACF_DBDELETE
-        else if lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
-  //      else if lstrcmpiw(tmp,ioRead)=0 then ;
-        tmp:=getAttrValue(HXML(node),ioContact);
-        if      lstrcmpiw(tmp,ioCurrent)=0 then flags:=flags or ACF_CURRENT
-        else if lstrcmpiw(tmp,ioResult )=0 then flags:=flags or ACF_RESULT
-        else if lstrcmpiw(tmp,ioParam  )=0 then flags:=flags or ACF_PARAM
-        else if lstrcmpiw(tmp,ioContact)=0 then
-        begin
-          dbcontact:=ImportContact(HXML(node));
-        end;
-
-        StrDupW(dbmodule ,getAttrValue(HXML(node),ioModule));
-        StrDupW(dbsetting,getAttrValue(HXML(node),ioSetting));
-
-        if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then flags:=flags or ACF_RW_MODULE;
-        if StrToInt(getAttrValue(HXML(node),ioArgVariable ))=1 then flags:=flags or ACF_RW_SETTING;
-        if StrToInt(getAttrValue(HXML(node),ioVariables   ))=1 then flags:=flags or ACF_RW_VALUE;
-	
-        tmp:=getAttrValue(HXML(node),ioType);
-        if      lstrcmpiw(tmp,ioByte )=0 then flags:=flags or ACF_DBBYTE
-        else if lstrcmpiw(tmp,ioWord )=0 then flags:=flags or ACF_DBWORD
-        else if lstrcmpiw(tmp,ioDword)=0 then
-        else if lstrcmpiw(tmp,ioAnsi )=0 then flags:=flags or ACF_DBANSI
-        else                                  flags:=flags or ACF_DBUTEXT;
-
-        if StrToInt(getAttrValue(HXML(node),ioSaveValue))=1 then
-          flags:=flags or ACF_SAVE;
-
-        if StrToInt(getAttrValue(HXML(node),ioLast))=1 then
-          flags:=flags or ACF_LAST
-        else
-          StrDupW(dbvalue,getText(HXML(node)));
-      end;
-    end;
-{
-    2: begin
-      pc:=GetParamSectionStr(node,ioOper);
-      if      lstrcmpi(pc,ioDelete)=0 then flags:=flags or ACF_DBDELETE
-      else if lstrcmpi(pc,ioWrite )=0 then flags:=flags or ACF_DBWRITE;
-//      else if lstrcmpiw(tmp,ioRead)=0 then ;
-      pc:=GetParamSectionStr(node,ioContact);
-      if      lstrcmpi(pc,ioCurrent)=0 then flags:=flags or ACF_CURRENT
-      else if lstrcmpi(pc,ioResult )=0 then flags:=flags or ACF_RESULT
-      else if lstrcmpi(pc,ioParam  )=0 then flags:=flags or ACF_PARAM
-      else if lstrcmpi(pc,ioContact)=0 then
-      begin
-        dbcontact:=ImportContactINI(node);
+        dbcontact:=ImportContact(HXML(node));
       end;
 
-      UF8ToWide(GetParamSectionStr(node,ioModule ),dbmodule);
-      UF8ToWide(GetParamSectionStr(node,ioSetting),dbsetting);
+      StrDupW(dbmodule ,xmlGetAttrValue(HXML(node),ioModule));
+      StrDupW(dbsetting,xmlGetAttrValue(HXML(node),ioSetting));
 
-      if GetParamSectionInt(node,ioFileVariable)=1 then flags:=flags or ACF_RW_MODULE;
-      if GetParamSectionInt(node,ioArgVariable )=1 then flags:=flags or ACF_RW_SETTING;
-      if GetParamSectionInt(node,ioVariables   )=1 then flags:=flags or ACF_RW_VALUE;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then flags:=flags or ACF_RW_MODULE;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable ))=1 then flags:=flags or ACF_RW_SETTING;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioVariables   ))=1 then flags:=flags or ACF_RW_VALUE;
+	
+      tmp:=xmlGetAttrValue(HXML(node),ioType);
+      if      lstrcmpiw(tmp,ioByte )=0 then flags:=flags or ACF_DBBYTE
+      else if lstrcmpiw(tmp,ioWord )=0 then flags:=flags or ACF_DBWORD
+      else if lstrcmpiw(tmp,ioDword)=0 then
+      else if lstrcmpiw(tmp,ioAnsi )=0 then flags:=flags or ACF_DBANSI
+      else                                  flags:=flags or ACF_DBUTEXT;
 
-      pc:=GetParamSectionStr(node,ioType);
-      if      lstrcmpi(pc,ioByte )=0 then flags:=flags or ACF_DBBYTE
-      else if lstrcmpi(pc,ioWord )=0 then flags:=flags or ACF_DBWORD
-      else if lstrcmpi(pc,ioDword)=0 then
-      else if lstrcmpi(pc,ioAnsi )=0 then flags:=flags or ACF_DBANSI
-      else                                flags:=flags or ACF_DBUTEXT;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioSaveValue))=1 then
+        flags:=flags or ACF_SAVE;
 
-      if GetParamSectionInt(node,ioLast))=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioLast))=1 then
         flags:=flags or ACF_LAST
       else
-        UF8ToWide(GetParamSectionStr(node,'value'),dbvalue); //!!
+        StrDupW(dbvalue,xmlGetText(HXML(node)));
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/iac_global.pas b/plugins/Actman/iac_global.pas
index aee55d1bfb..aa5b9bb87c 100644
--- a/plugins/Actman/iac_global.pas
+++ b/plugins/Actman/iac_global.pas
@@ -14,9 +14,6 @@ const
   rtAnsi = 3;
   rtUTF8 = 4;
 
-var
-  xmlparser:TXML_API_W;
-
 const
   IcoLibPrefix = 'action_type_';
 const
@@ -175,22 +172,11 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        if StrToInt(getAttrValue(HXML(node),ioDisabled))=1 then
-          flags:=flags or ACF_DISABLED;
-
-        StrDupW(ActionDescr,getAttrValue(HXML(node),ioName));
-      end;
-    end;
-{
-    2: begin
-      if GetParamSectionInt(node,ioDisabled))=1 then
+      if StrToInt(xmlGetAttrValue(HXML(node),ioDisabled))=1 then
         flags:=flags or ACF_DISABLED;
 
-      UF8ToWide(GetParamSectionStr(node,ioName),ActionDescr);
+      StrDupW(ActionDescr,xmlGetAttrValue(HXML(node),ioName));
     end;
-}
   end;
 end;
 
@@ -335,36 +321,33 @@ var
   is_chat:boolean;
   bufLen:int; 
 begin
-  with xmlparser do
+  proto:=FastWideToAnsiBuf(xmlGetAttrValue(node,ioCProto),tmpbuf);
+  if (proto=nil) or (proto^=#0) then
   begin
-    proto:=FastWideToAnsiBuf(getAttrValue(node,ioCProto),tmpbuf);
-    if (proto=nil) or (proto^=#0) then
-    begin
-      result:=0;
-      exit;
-    end;
-    is_chat:=StrToInt(getAttrValue(node,ioIsChat))<>0;
+    result:=0;
+    exit;
+  end;
+  is_chat:=StrToInt(xmlGetAttrValue(node,ioIsChat))<>0;
 
-    tmp:=getAttrValue(node,ioCUID);
-    if is_chat then
-    begin
-      dbv.szVal.W:=tmp;
-    end
-    else
-    begin
-      FillChar(dbv,SizeOf(TDBVARIANT),0);
-      dbv._type:=StrToInt(getAttrValue(node,ioCUIDType));
-      case dbv._type of
-        DBVT_BYTE  : dbv.bVal:=StrToInt(tmp);
-        DBVT_WORD  : dbv.wVal:=StrToInt(tmp);
-        DBVT_DWORD : dbv.dVal:=StrToInt(tmp);
-        DBVT_ASCIIZ: FastWideToAnsi(tmp,dbv.szVal.A);
-        DBVT_UTF8  : WideToUTF8(tmp,dbv.szVal.A);
-        DBVT_WCHAR : dbv.szVal.W:=tmp;
-        DBVT_BLOB  : begin
-          dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
-          dbv.cpbVal := bufLen;
-        end;
+  tmp:=xmlGetAttrValue(node,ioCUID);
+  if is_chat then
+  begin
+    dbv.szVal.W:=tmp;
+  end
+  else
+  begin
+    FillChar(dbv,SizeOf(TDBVARIANT),0);
+    dbv._type:=StrToInt(xmlGetAttrValue(node,ioCUIDType));
+    case dbv._type of
+      DBVT_BYTE  : dbv.bVal:=StrToInt(tmp);
+      DBVT_WORD  : dbv.wVal:=StrToInt(tmp);
+      DBVT_DWORD : dbv.dVal:=StrToInt(tmp);
+      DBVT_ASCIIZ: FastWideToAnsi(tmp,dbv.szVal.A);
+      DBVT_UTF8  : WideToUTF8(tmp,dbv.szVal.A);
+      DBVT_WCHAR : dbv.szVal.W:=tmp;
+      DBVT_BLOB  : begin
+        dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
+        dbv.cpbVal := bufLen;
       end;
     end;
   end;
diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas
index 5ae7a1cedf..b5fcbb466a 100644
--- a/plugins/Actman/iac_inout.pas
+++ b/plugins/Actman/iac_inout.pas
@@ -327,36 +327,32 @@ begin
     end;
 
     1: begin
-      with xmlparser do
+      tmp:=xmlGetAttrValue(HXML(node),ioObject);
+      if lstrcmpiw(tmp,ioClipboard)=0 then
       begin
-        tmp:=getAttrValue(HXML(node),ioObject);
-        if lstrcmpiw(tmp,ioClipboard)=0 then
-        begin
-          flags:=flags or ACF_CLIPBRD;
-          tmp:=getAttrValue(HXML(node),ioOper);
-          if lstrcmpiw(tmp,ioCopy)=0 then flags:=flags or ACF_COPYTO;
-  //        else if lstrcmpiw(tmp,'paste')=0 then ;
-        end
-        else
+        flags:=flags or ACF_CLIPBRD;
+        tmp:=xmlGetAttrValue(HXML(node),ioOper);
+        if lstrcmpiw(tmp,ioCopy)=0 then flags:=flags or ACF_COPYTO;
+      end
+      else
+      begin
+        if lstrcmpiw(tmp,ioFile)=0 then
         begin
-          if lstrcmpiw(tmp,ioFile)=0 then
-          begin
 
-            if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then
-              flags:=flags or ACF_FILE_PATH;
-
-            flags:=flags or ACF_FILE;
-            StrDupW(tfile,getAttrValue(HXML(node),ioFile));
-            tmp:=getAttrValue(HXML(node),ioOper);
-            if      lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_FWRITE
-            else if lstrcmpiw(tmp,ioAppend)=0 then flags:=flags or ACF_FAPPEND;
-            case StrToInt(getAttrValue(HXML(node),ioEnc)) of
-              0: flags:=flags or ACF_ANSI;
-              1: flags:=flags or ACF_UTF8;
-              2: flags:=flags or ACF_UTF8 or ACF_SIGN;
-              3: flags:=flags or 0;
-              4: flags:=flags or ACF_SIGN;
-            end;
+          if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then
+            flags:=flags or ACF_FILE_PATH;
+
+          flags:=flags or ACF_FILE;
+          StrDupW(tfile,xmlGetAttrValue(HXML(node),ioFile));
+          tmp:=xmlGetAttrValue(HXML(node),ioOper);
+          if      lstrcmpiw(tmp,ioWrite )=0 then flags:=flags or ACF_FWRITE
+          else if lstrcmpiw(tmp,ioAppend)=0 then flags:=flags or ACF_FAPPEND;
+          case StrToInt(xmlGetAttrValue(HXML(node),ioEnc)) of
+            0: flags:=flags or ACF_ANSI;
+            1: flags:=flags or ACF_UTF8;
+            2: flags:=flags or ACF_UTF8 or ACF_SIGN;
+            3: flags:=flags or 0;
+            4: flags:=flags or ACF_SIGN;
           end;
         end;
       end;
diff --git a/plugins/Actman/iac_jump.pas b/plugins/Actman/iac_jump.pas
index 4ac0473405..8e2bba787c 100644
--- a/plugins/Actman/iac_jump.pas
+++ b/plugins/Actman/iac_jump.pas
@@ -293,100 +293,54 @@ begin
     end;
 
     1: begin
-      with xmlparser do
+      sub:=xmlGetNthChild(HXML(node),ioIf,0);
+      if sub<>0 then
       begin
-        sub:=getNthChild(HXML(node),ioIf,0);
-        if sub<>0 then
-        begin
-          tmp:=getAttrValue(sub,ioOper);
-          if      lstrcmpiw(tmp,'math')=0 then flags:=flags or ACF_MATH
-          else if lstrcmpiw(tmp,ioNop )=0 then flags:=flags or ACF_NOP;
+        tmp:=xmlGetAttrValue(sub,ioOper);
+        if      lstrcmpiw(tmp,'math')=0 then flags:=flags or ACF_MATH
+        else if lstrcmpiw(tmp,ioNop )=0 then flags:=flags or ACF_NOP;
 
-          tmp:=getAttrValue(sub,ioCond);
-          if lstrcmpiw(tmp,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
-          else if (flags and ACF_NOP)=0 then
+        tmp:=xmlGetAttrValue(sub,ioCond);
+        if lstrcmpiw(tmp,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
+        else if (flags and ACF_NOP)=0 then
+        begin
+          if flags and ACF_MATH<>0 then
           begin
-            if flags and ACF_MATH<>0 then
-            begin
-              if      lstrcmpiw(tmp,'gt' )=0 then condition:=aeGT
-              else if lstrcmpiw(tmp,'lt' )=0 then condition:=aeLT
-              else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQ
-              else if lstrcmpiw(tmp,'xor')=0 then condition:=aeXR
-              else if lstrcmpiw(tmp,'and')=0 then condition:=aeND;
-            end
-            else
-            begin
-              if      lstrcmpiw(tmp,'empty')=0 then condition:=aeEMP
-              else if lstrcmpiw(tmp,'eq'   )=0 then condition:=aeEQU
-              else if lstrcmpiw(tmp,'cont' )=0 then condition:=aeCON
-              else if lstrcmpiw(tmp,'start')=0 then condition:=aeSTR
-              else if lstrcmpiw(tmp,'ends' )=0 then condition:=aeEND;
-
-              if StrToInt(getAttrValue(sub,ioCase))=1 then
-                flags:=flags or ACF_CASE;
-              if StrToInt(getAttrValue(sub,ioBack))=1 then
-                flags:=flags or ACF_BACK;
-            end;
-            if StrToInt(getAttrValue(sub,ioNot))=1 then
-              flags:=flags or ACF_NOT;
-
-            if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
-              StrDupW(value,getAttrValue(sub,ioValue));
+            if      lstrcmpiw(tmp,'gt' )=0 then condition:=aeGT
+            else if lstrcmpiw(tmp,'lt' )=0 then condition:=aeLT
+            else if lstrcmpiw(tmp,'eq' )=0 then condition:=aeEQ
+            else if lstrcmpiw(tmp,'xor')=0 then condition:=aeXR
+            else if lstrcmpiw(tmp,'and')=0 then condition:=aeND;
+          end
+          else
+          begin
+            if      lstrcmpiw(tmp,'empty')=0 then condition:=aeEMP
+            else if lstrcmpiw(tmp,'eq'   )=0 then condition:=aeEQU
+            else if lstrcmpiw(tmp,'cont' )=0 then condition:=aeCON
+            else if lstrcmpiw(tmp,'start')=0 then condition:=aeSTR
+            else if lstrcmpiw(tmp,'ends' )=0 then condition:=aeEND;
+
+            if StrToInt(xmlGetAttrValue(sub,ioCase))=1 then
+              flags:=flags or ACF_CASE;
+            if StrToInt(xmlGetAttrValue(sub,ioBack))=1 then
+              flags:=flags or ACF_BACK;
           end;
-        end;
+          if StrToInt(xmlGetAttrValue(sub,ioNot))=1 then
+            flags:=flags or ACF_NOT;
 
-        sub:=getNthChild(HXML(node),ioPost,0);
-        if sub<>0 then
-        begin
-          tmp:=getAttrValue(sub,ioOper);
-          if      lstrcmpiw(tmp,ioBreak)=0 then flags:=flags or ACF_BREAK
-          else if lstrcmpiw(tmp,ioJump )=0 then StrDupW(actlabel,getAttrValue(sub,ioValue));
+          if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
+            StrDupW(value,xmlGetAttrValue(sub,ioValue));
         end;
       end;
-    end;
-{
-    2: begin
-      pc:=GetParamSectionStr(node,ioOper);
-      if      lstrcmpi(pc,'math')=0 then flags:=flags or ACF_MATH
-      else if lstrcmpi(pc,ioNop )=0 then flags:=flags or ACF_NOP;
-
-      pc:=GetParamSectionStr(node,ioCond);
-      if lstrcmpi(pc,ioNop)=0 then flags:=flags or ACF_NOP // compatibility
-      else if (flags and ACF_NOP)=0 then
-      begin
-        if flags and ACF_MATH<>0 then
-        begin
-          if      lstrcmpi(pc,'gt' )=0 then condition:=aeGT
-          else if lstrcmpi(pc,'lt' )=0 then condition:=aeLT
-          else if lstrcmpi(pc,'eq' )=0 then condition:=aeEQ
-          else if lstrcmpi(pc,'xor')=0 then condition:=aeXR
-          else if lstrcmpi(pc,'and')=0 then condition:=aeND;
-        end
-        else
-        begin
-          if      lstrcmpi(pc,'empty')=0 then condition:=aeEMP
-          else if lstrcmpi(pc,'eq'   )=0 then condition:=aeEQU
-          else if lstrcmpi(pc,'cont' )=0 then condition:=aeCON
-          else if lstrcmpi(pc,'start')=0 then condition:=aeSTR
-          else if lstrcmpi(pc,'ends' )=0 then condition:=aeEND;
-
-          if GetParamSectionInt(node,ioCase)=1 then
-            flags:=flags or ACF_CASE;
-          if GetParamSectionInt(node,ioBack)=1 then
-            flags:=flags or ACF_BACK;
-        end;
-        if GetParamSectionInt(node,ioNot)=1 then
-          flags:=flags or ACF_NOT;
 
-        if ((flags and ACF_MATH)<>0) or (condition<>aeEMP) then
-          UTF8ToWide(GetParamSectionStr(node,ioValue),value);
+      sub:=xmlGetNthChild(HXML(node),ioPost,0);
+      if sub<>0 then
+      begin
+        tmp:=xmlGetAttrValue(sub,ioOper);
+        if      lstrcmpiw(tmp,ioBreak)=0 then flags:=flags or ACF_BREAK
+        else if lstrcmpiw(tmp,ioJump )=0 then StrDupW(actlabel,xmlGetAttrValue(sub,ioValue));
       end;
-
-      pc:=GetParamSectionStr(node,ioAction);
-      if      lstrcmpi(pc,ioBreak)=0 then flags:=flags or ACF_BREAK
-      else if lstrcmpi(pc,ioJump )=0 then UTF8ToWide(GetParamSectionStr(node,ioLabel),actlabel);
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/iac_messagebox.pas b/plugins/Actman/iac_messagebox.pas
index 41a1068ab2..78320e1cd5 100644
--- a/plugins/Actman/iac_messagebox.pas
+++ b/plugins/Actman/iac_messagebox.pas
@@ -147,26 +147,13 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        StrDupW(msgtitle,getAttrValue(HXML(node),ioTitle));
-        StrDupW(msgtext,getText(HXML(node)));
-        boxopts:=StrToInt(getAttrValue(HXML(node),ioType));
-
-        if StrToInt(getAttrValue(HXML(node),ioArgVariable))=1 then flags:=flags or ACF_MSG_TXT;
-        if StrToInt(getAttrValue(HXML(node),ioVariables  ))=1 then flags:=flags or ACF_MSG_TTL;
-      end;
-    end;
-{
-    2: begin
-      UTF8ToWide(GetParamSectionInt(node,ioTitle),msgtitle);
-      UTF8ToWide(GetParamSectionInt(node,ioText ),msgtext);
-      boxopts:=GetParamSectionInt(node,ioType);
+      StrDupW(msgtitle,xmlGetAttrValue(HXML(node),ioTitle));
+      StrDupW(msgtext,xmlGetText(HXML(node)));
+      boxopts:=StrToInt(xmlGetAttrValue(HXML(node),ioType));
 
-      if GetParamSectionInt(node,ioArgVariable)=1 then flags:=flags or ACF_MSG_TXT;
-      if GetParamSectionInt(node,ioVariables  )=1 then flags:=flags or ACF_MSG_TTL;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable))=1 then flags:=flags or ACF_MSG_TXT;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioVariables  ))=1 then flags:=flags or ACF_MSG_TTL;
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/iac_program.pas b/plugins/Actman/iac_program.pas
index 33924c4279..d16c356019 100644
--- a/plugins/Actman/iac_program.pas
+++ b/plugins/Actman/iac_program.pas
@@ -244,30 +244,27 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        StrDupW(prgname,getText(HXML(node)));
-        StrDupW(args,getAttrValue(HXML(node),ioArgs));
-        if StrToInt(getAttrValue(HXML(node),ioCurrent))=1 then
-          flags:=flags or ACF_CURPATH;
+      StrDupW(prgname,xmlGetText(HXML(node)));
+      StrDupW(args,xmlGetAttrValue(HXML(node),ioArgs));
+      if StrToInt(xmlGetAttrValue(HXML(node),ioCurrent))=1 then
+        flags:=flags or ACF_CURPATH;
 
-        if StrToInt(getAttrValue(HXML(node),ioParallel))=1 then
-          flags:=flags or ACF_PRTHREAD
-        else
-          time:=StrToInt(getAttrValue(HXML(node),ioWait));
+      if StrToInt(xmlGetAttrValue(HXML(node),ioParallel))=1 then
+        flags:=flags or ACF_PRTHREAD
+      else
+        time:=StrToInt(xmlGetAttrValue(HXML(node),ioWait));
 
-        if StrToInt(getAttrValue(HXML(node),ioFileVariable))=1 then
-          flags:=flags or ACF_PRG_PRG;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioFileVariable))=1 then
+        flags:=flags or ACF_PRG_PRG;
 
-        if StrToInt(getAttrValue(HXML(node),ioArgVariable))=1 then
-          flags:=flags or ACF_PRG_ARG;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioArgVariable))=1 then
+        flags:=flags or ACF_PRG_ARG;
 
-        tmp:=getAttrValue(HXML(node),ioWindow);
-        if      lstrcmpiw(tmp,ioHidden   )=0 then show:=SW_HIDE
-        else if lstrcmpiw(tmp,ioMinimized)=0 then show:=SW_SHOWMINIMIZED
-        else if lstrcmpiw(tmp,ioMaximized)=0 then show:=SW_SHOWMAXIMIZED
-        else                                      show:=SW_SHOWNORMAL;
-      end;
+      tmp:=xmlGetAttrValue(HXML(node),ioWindow);
+      if      lstrcmpiw(tmp,ioHidden   )=0 then show:=SW_HIDE
+      else if lstrcmpiw(tmp,ioMinimized)=0 then show:=SW_SHOWMINIMIZED
+      else if lstrcmpiw(tmp,ioMaximized)=0 then show:=SW_SHOWMAXIMIZED
+      else                                      show:=SW_SHOWNORMAL;
     end;
 {
     2: begin
diff --git a/plugins/Actman/iac_service.pas b/plugins/Actman/iac_service.pas
index cfeb456191..1868b89214 100644
--- a/plugins/Actman/iac_service.pas
+++ b/plugins/Actman/iac_service.pas
@@ -174,25 +174,22 @@ begin
   result:=ACF_TYPE_NUMBER;
   if act=0 then
     exit;
-  with xmlparser do
+  
+  tmp:=xmlGetAttrValue(act,ioType);
+  if      lstrcmpiw(tmp,ioCurrent)=0 then result:=ACF_TYPE_CURRENT
+  else if lstrcmpiw(tmp,ioResult )=0 then result:=ACF_TYPE_RESULT
+  else if lstrcmpiw(tmp,ioParam  )=0 then result:=ACF_TYPE_PARAM
+  else if lstrcmpiw(tmp,ioStruct )=0 then
   begin
-    tmp:=getAttrValue(act,ioType);
-    if      lstrcmpiw(tmp,ioCurrent)=0 then result:=ACF_TYPE_CURRENT
-    else if lstrcmpiw(tmp,ioResult )=0 then result:=ACF_TYPE_RESULT
-    else if lstrcmpiw(tmp,ioParam  )=0 then result:=ACF_TYPE_PARAM
-    else if lstrcmpiw(tmp,ioStruct )=0 then
-    begin
-      result:=ACF_TYPE_STRUCT;
-//!!!!      param:=ReadStruct(act);
-    end
-    else
-    begin
-      StrDupW(pWideChar(param),getAttrValue(act,ioValue));
-
-      if      lstrcmpiw(tmp,ioNumber )=0 then result:=ACF_TYPE_NUMBER
-      else if lstrcmpiw(tmp,ioUnicode)=0 then result:=ACF_TYPE_UNICODE
-      else if lstrcmpiw(tmp,ioAnsi   )=0 then result:=ACF_TYPE_STRING;
-    end;
+    result:=ACF_TYPE_STRUCT;
+  end
+  else
+  begin
+    StrDupW(pWideChar(param),xmlGetAttrValue(act,ioValue));
+
+    if      lstrcmpiw(tmp,ioNumber )=0 then result:=ACF_TYPE_NUMBER
+    else if lstrcmpiw(tmp,ioUnicode)=0 then result:=ACF_TYPE_UNICODE
+    else if lstrcmpiw(tmp,ioAnsi   )=0 then result:=ACF_TYPE_STRING;
   end;
 end;
 {
@@ -329,60 +326,32 @@ begin
       service.w_flags:=0;
       service.l_flags:=0;
 
-      with xmlparser do
-      begin
-        FastWideToAnsi(getAttrValue(HXML(node),ioService),service.service);
-//!!!!        StrDupW(service,getAttrValue(HXML(node),ioService));
-        if StrToInt(getAttrValue(HXML(node),ioVariables))=1 then
-          service.flags:=service.flags or ACF_FLAG_SCRIPT;
+      FastWideToAnsi(xmlGetAttrValue(HXML(node),ioService),service.service);
+      if StrToInt(xmlGetAttrValue(HXML(node),ioVariables))=1 then
+        service.flags:=service.flags or ACF_FLAG_SCRIPT;
 
-        sub:=getNthChild(HXML(node),ioWParam,0);
-        if StrToInt(getAttrValue(sub,ioVariables))=1 then
-          service.w_flags:=service.w_flags or ACF_FLAG_SCRIPT;
-        service.w_flags:=service.w_flags or
-            ReadParam(sub,PWideChar(service.wparam),(service.w_flags and ACF_FLAG_SCRIPT)<>0);
-
-        sub:=getNthChild(HXML(node),ioLParam,0);
-        if StrToInt(getAttrValue(sub,ioVariables))=1 then
-          service.l_flags:=service.l_flags or ACF_FLAG_SCRIPT;
-        service.l_flags:=service.l_flags or
-            ReadParam(sub,PWideChar(service.lparam),(service.l_flags and ACF_FLAG_SCRIPT)<>0);
-
-        sub:=getNthChild(HXML(node),ioOutput,0);
-        if StrToInt(getAttrValue(sub,ioFree))=1 then
-          service.flags:=service.flags or ACF_FLAG_FREEMEM;
-
-        tmp:=getAttrValue(sub,ioType);
-        if      lstrcmpiw(tmp,ioUnicode)=0 then service.flags:=service.flags or ACF_TYPE_UNICODE
-        else if lstrcmpiw(tmp,ioAnsi   )=0 then service.flags:=service.flags or ACF_TYPE_STRING
-        else if lstrcmpiw(tmp,ioStruct )=0 then service.flags:=service.flags or ACF_TYPE_STRUCT
-        else if lstrcmpiw(tmp,ioInt    )=0 then service.flags:=service.flags or ACF_TYPE_NUMBER;
-      end;
-    end;
-{
-    2: begin
-      StrDup(service,GetParamSectionStr(node,ioService));
-//!!!!      UTF8ToWide(GetParamSectionStr(node,ioService),service);
-      if GetParamSectionInt(node,ioVariables)=1 then
-        flags:=flags or ACF_SCRIPT_SERVICE;
-
-      if GetParamSectionInt(node,ioWParam+'.'+ioVariables))=1 then
-        flags:=flags or ACF_SCRIPT_PARAM;
-      flags:=flags or ReadParamINI(node,ioWParam+'.',wparam,(flags and ACF_SCRIPT_PARAM)<>0);
-
-      if GetParamSectionInt(node,ioLParam+'.'+ioVariables))=1 then
-        flags2:=flags2 or ACF_SCRIPT_PARAM;
-      flags2:=flags2 or ReadParamINI(node,ioLParam+'.',lparam,(flags2 and ACF_SCRIPT_PARAM)<>0);
-
-      if GetParamSectionInt(node,ioFree)=1 then flags:=flags or ACF_RFREEMEM;
-
-      pc:=GetParamSectionStr(node,ioType);
-      if      lstrcmpi(p�,ioUnicode)=0 then flags:=flags or ACF_RUNICODE
-      else if lstrcmpi(p�,ioAnsi   )=0 then flags:=flags or ACF_RSTRING
-      else if lstrcmpi(p�,ioStruct )=0 then flags:=flags or ACF_RSTRUCT
-//      else if lstrcmpi(p�,ioInt    )=0 then ;
+      sub:=xmlGetNthChild(HXML(node),ioWParam,0);
+      if StrToInt(xmlGetAttrValue(sub,ioVariables))=1 then
+        service.w_flags:=service.w_flags or ACF_FLAG_SCRIPT;
+      service.w_flags:=service.w_flags or
+          ReadParam(sub,PWideChar(service.wparam),(service.w_flags and ACF_FLAG_SCRIPT)<>0);
+
+      sub:=xmlGetNthChild(HXML(node),ioLParam,0);
+      if StrToInt(xmlGetAttrValue(sub,ioVariables))=1 then
+        service.l_flags:=service.l_flags or ACF_FLAG_SCRIPT;
+      service.l_flags:=service.l_flags or
+          ReadParam(sub,PWideChar(service.lparam),(service.l_flags and ACF_FLAG_SCRIPT)<>0);
+
+      sub:=xmlGetNthChild(HXML(node),ioOutput,0);
+      if StrToInt(xmlGetAttrValue(sub,ioFree))=1 then
+        service.flags:=service.flags or ACF_FLAG_FREEMEM;
+
+      tmp:=xmlGetAttrValue(sub,ioType);
+      if      lstrcmpiw(tmp,ioUnicode)=0 then service.flags:=service.flags or ACF_TYPE_UNICODE
+      else if lstrcmpiw(tmp,ioAnsi   )=0 then service.flags:=service.flags or ACF_TYPE_STRING
+      else if lstrcmpiw(tmp,ioStruct )=0 then service.flags:=service.flags or ACF_TYPE_STRUCT
+      else if lstrcmpiw(tmp,ioInt    )=0 then service.flags:=service.flags or ACF_TYPE_NUMBER;
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/iac_storage.pas b/plugins/Actman/iac_storage.pas
index 500d366334..186e88240a 100644
--- a/plugins/Actman/iac_storage.pas
+++ b/plugins/Actman/iac_storage.pas
@@ -155,12 +155,9 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        if lstrcmpiw(getAttrValue(HXML(node),ioOper),ioCopy)=1 then
-           flags:=flags or ACF_COPYFROM;
-        Number:=StrToInt(getAttrValue(HXML(node),ioNumber));
-      end;
+      if lstrcmpiw(xmlGetAttrValue(HXML(node),ioOper),ioCopy)=1 then
+         flags:=flags or ACF_COPYFROM;
+      Number:=StrToInt(xmlGetAttrValue(HXML(node),ioNumber));
     end;
   end;
 end;
diff --git a/plugins/Actman/iac_text.pas b/plugins/Actman/iac_text.pas
index 68f9acf7ba..8614d6430e 100644
--- a/plugins/Actman/iac_text.pas
+++ b/plugins/Actman/iac_text.pas
@@ -361,22 +361,12 @@ begin
     end;
 
     1: begin
-      with xmlparser do
-      begin
-        StrDupW(text,getText(HXML(node)));
-        if StrToInt(getAttrValue(HXML(node),ioVariables))=1 then
-          flags:=flags or ACF_TEXTSCRIPT;
-        if StrToInt(getAttrValue(HXML(node),ioPost))=1 then
-          flags:=flags or ACF_POSTPROCESS;
-      end;
-    end;
-{
-    2: begin
-      UTF8ToWide(GetParamSectionInt(node,ioText),text);
-      if GetParamSectionInt(node,ioVariables)=1 then
+      StrDupW(text,xmlGetText(HXML(node)));
+      if StrToInt(xmlGetAttrValue(HXML(node),ioVariables))=1 then
         flags:=flags or ACF_TEXTSCRIPT;
+      if StrToInt(xmlGetAttrValue(HXML(node),ioPost))=1 then
+        flags:=flags or ACF_POSTPROCESS;
     end;
-}
   end;
 end;
 
diff --git a/plugins/Actman/inoutxml.pas b/plugins/Actman/inoutxml.pas
index cd11c1a963..bcf91222bf 100644
--- a/plugins/Actman/inoutxml.pas
+++ b/plugins/Actman/inoutxml.pas
@@ -31,17 +31,14 @@ var
 begin
   result:=nil;
   if actnode=0 then exit;
-  with xmlparser do
+  pa:=GetLinkByName(FastWideToAnsiBuf(xmlGetAttrValue(actnode,ioClass),buf));
+  if pa<>nil then
   begin
-    pa:=GetLinkByName(FastWideToAnsiBuf(getAttrValue(actnode,ioClass),buf));
-    if pa<>nil then
-    begin
-      result:=pa.Create;
-      result.Load(pointer(actnode),1);
-    end
-    else
-      result:=tBaseAction(1);
-  end;
+    result:=pa.Create;
+    result.Load(pointer(actnode),1);
+  end
+  else
+    result:=tBaseAction(1);
 end;
 
 function Import(list:tMacroList;fname:PWideChar;aflags:dword):integer;
@@ -76,79 +73,72 @@ begin
   BlockRead(f,res^,i);
   CloseHandle(f);
 
-//MessageBoxW(0,res,'SRC',0);
-  xmlparser.cbSize:=SizeOf(TXML_API_W);
-  CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
-  with xmlparser do
-  begin
-    root:=parseString(ChangeUnicode(res),@i,nil);
-    nodenum:=0;
-    impact:=imp_yes;
-    repeat
-      actnode:=getNthChild(root,ioAction,nodenum);
-      if actnode=0 then break;
-//??      if StrCmpW(getName(actnode),ioAction)<>0 then break;
-      tmp:=getAttrValue(actnode,ioName);
-      if tmp<>nil then //!!
+  root:=xmlParseString(ChangeUnicode(res),@i,nil);
+  nodenum:=0;
+  impact:=imp_yes;
+  repeat
+    actnode:=xmlGetNthChild(root,ioAction,nodenum);
+    if actnode=0 then break;
+    tmp:=xmlGetAttrValue(actnode,ioName);
+    if tmp<>nil then //!!
+    begin
+      p:=list.GetMacro(tmp);
+      oldid:=$FFFFFFFF;
+      if p<>nil then
       begin
-        p:=list.GetMacro(tmp);
-        oldid:=$FFFFFFFF;
-        if p<>nil then
+        if (impact<>imp_yesall) and (impact<>imp_noall) then
         begin
-          if (impact<>imp_yesall) and (impact<>imp_noall) then
-          begin
-            StrCopyW(buf,TranslateW('Action "$" exists, do you want to rewrite it?'));
-            impact:=ShowQuestion(StrReplaceW(buf,'$',tmp));
-          end;
-          if (impact=imp_yesall) or (impact=imp_yes) then
-          begin
-            oldid:=p^.id;
-            FreeMacro(p);
-          end;
+          StrCopyW(buf,TranslateW('Action "$" exists, do you want to rewrite it?'));
+          impact:=ShowQuestion(StrReplaceW(buf,'$',tmp));
         end;
-        // if new or overwriting then read macro details/actions
-        if (p=nil) or (impact=imp_yesall) or (impact=imp_yes) or (impact=imp_append) then
+        if (impact=imp_yesall) or (impact=imp_yes) then
         begin
-          with List[list.NewMacro()]^ do
+          oldid:=p^.id;
+          FreeMacro(p);
+        end;
+      end;
+      // if new or overwriting then read macro details/actions
+      if (p=nil) or (impact=imp_yesall) or (impact=imp_yes) or (impact=imp_append) then
+      begin
+        with List[list.NewMacro()]^ do
+        begin
+          if (p<>nil) and (oldid<>$FFFFFFFF) then // set old id to keep UseAction setting
           begin
-            if (p<>nil) and (oldid<>$FFFFFFFF) then // set old id to keep UseAction setting
-            begin
-              flags:=flags or ACF_IMPORT or ACF_OVERLOAD;
-              id:=oldid;
-            end
-            else
-              flags:=flags or ACF_IMPORT;
-            if StrToInt(getAttrValue(actnode,ioVolatile))=1 then flags:=flags or ACF_VOLATILE;
-            StrCopyW(descr,tmp,MacroNameLen-1);
+            flags:=flags or ACF_IMPORT or ACF_OVERLOAD;
+            id:=oldid;
+          end
+          else
+            flags:=flags or ACF_IMPORT;
+          if StrToInt(xmlGetAttrValue(actnode,ioVolatile))=1 then flags:=flags or ACF_VOLATILE;
+          StrCopyW(descr,tmp,MacroNameLen-1);
 
-            // reading actions
-            actcnt:=0; // count in file 
-            ActionCount:=0;      // amount of loaded
-            repeat
-              act:=ImportAction(getChild(actnode,actcnt));
-              if act=nil then
-                break;
-              if uint_ptr(act)<>1 then
-              begin
-                arr[ActionCount]:=act;
-                inc(ActionCount);
-              end;
-              inc(actcnt);
-            until false;
-            // moving actions to their place
-            if Actioncount>0 then
+          // reading actions
+          actcnt:=0; // count in file 
+          ActionCount:=0;      // amount of loaded
+          repeat
+            act:=ImportAction(xmlGetChild(actnode,actcnt));
+            if act=nil then
+              break;
+            if uint_ptr(act)<>1 then
             begin
-              GetMem(ActionList,SizeOf(tBaseAction)*ActionCount);
-              move(arr,ActionList^,SizeOf(tBaseAction)*ActionCount);
+              arr[ActionCount]:=act;
+              inc(ActionCount);
             end;
-            inc(result);
+            inc(actcnt);
+          until false;
+          // moving actions to their place
+          if Actioncount>0 then
+          begin
+            GetMem(ActionList,SizeOf(tBaseAction)*ActionCount);
+            move(arr,ActionList^,SizeOf(tBaseAction)*ActionCount);
           end;
+          inc(result);
         end;
       end;
-      inc(nodenum);
-    until false;
-    destroyNode(root);
-  end;
+    end;
+    inc(nodenum);
+  until false;
+  xmlDestroyNode(root);
   mFreeMem(res);
 end;
 
diff --git a/plugins/Actman/ua/i_inoutjson.inc b/plugins/Actman/ua/i_inoutjson.inc
index b560e99fb1..95f793e9f2 100644
--- a/plugins/Actman/ua/i_inoutjson.inc
+++ b/plugins/Actman/ua/i_inoutjson.inc
@@ -342,7 +342,7 @@ begin
     f:=Rewrite(fname);
     BlockWrite(f,res^,i*SizeOf(WideChar));
     CloseHandle(f);
-    xmlparser.FreeMem(res);
+    FreeMem(res);
     DestroyNode(root);
   end;
   result:=1;
diff --git a/plugins/Actman/ua/i_inoutxm.inc b/plugins/Actman/ua/i_inoutxm.inc
index bf53ff954a..4a539a8275 100644
--- a/plugins/Actman/ua/i_inoutxm.inc
+++ b/plugins/Actman/ua/i_inoutxm.inc
@@ -1,6 +1,4 @@
 {}
-var
-  xmlparser:TXML_API_W;
 
 const
   ioAction         :PWideChar = 'Action';
@@ -32,27 +30,24 @@ function ImportMenuItems(node:HXML;var MenuItem:tUAMenuItem):integer;
 begin
   result:=0;
 
-  with xmlparser do
+  with MenuItem do
   begin
-    with MenuItem do
-    begin
-      menu_opt:=0;
-    // popup
-      StrDupW(szMenuPopup,getAttrValue(node,ioMenuPopup));
-    // name
-      StrDupW(szMenuNameVars,getAttrValue(node,ioMenuName));
-    // show
-      StrDupW(szMenuShowWhenVars,getAttrValue(node,ioMenuShow));
-    // used
-      if StrToInt(getAttrValue(node,ioMenuUsed))<>0 then
-        menu_opt:=menu_opt or UAF_MENUUSE;
-    // separated
-      if StrToInt(getAttrValue(node,ioMenuSeparated))<>0 then
-        menu_opt:=menu_opt or UAF_MENUSEP;
-    // no translate
-      if StrToInt(getAttrValue(node,ioNoTranslate))<>0 then
-        menu_opt:=menu_opt or UAF_NOTRANS;
-    end;
+    menu_opt:=0;
+  // popup
+    StrDupW(szMenuPopup,xmlGetAttrValue(node,ioMenuPopup));
+  // name
+    StrDupW(szMenuNameVars,xmlGetAttrValue(node,ioMenuName));
+  // show
+    StrDupW(szMenuShowWhenVars,xmlGetAttrValue(node,ioMenuShow));
+  // used
+    if StrToInt(xmlGetAttrValue(node,ioMenuUsed))<>0 then
+      menu_opt:=menu_opt or UAF_MENUUSE;
+  // separated
+    if StrToInt(xmlGetAttrValue(node,ioMenuSeparated))<>0 then
+      menu_opt:=menu_opt or UAF_MENUSEP;
+  // no translate
+    if StrToInt(xmlGetAttrValue(node,ioNoTranslate))<>0 then
+      menu_opt:=menu_opt or UAF_NOTRANS;
   end;
 end;
 
@@ -64,52 +59,44 @@ begin
   result:=0;
   if actnode=0 then exit;
 
-  with xmlparser do
-  begin
-    // we don't need that node as is, just it's child for UA
-//    actnode:=GetNthChild(actnode,ioUA,0);
-
-    UA.flags:=0;
-    // ----- Common -----
-    if StrToInt(getAttrValue(actnode,ioTwoState))<>0 then
-      UA.flags:=UA.flags or UAF_2STATE;
-
-    if StrToInt(getAttrValue(actnode,ioSaveState))<>0 then
-      UA.flags:=UA.flags or UAF_SAVESTATE;
-
-  //      sub:=AddChild(actnode,ioRegister,nil);
-    if StrToInt(getAttrValue(actnode,ioHotkey))<>0 then
-      UA.flags:=UA.flags or UAF_REGHOTKEY;
-    if StrToInt(getAttrValue(actnode,ioToolbar))<>0 then
-      UA.flags:=UA.flags or UAF_REGTTBB;
-    if StrToInt(getAttrValue(actnode,ioTabSRMM))<>0 then
-      UA.flags:=UA.flags or UAF_REGTABB;
-
-    // ----- Hotkey -----
-    // nothing
-
-    // ----- Modern CList toolbar -----
-    // source - ANSI text
-    sub:=GetNthChild(actnode,ioToolbar,0);
-    WideToAnsi(GetAttrValue(sub,ioTooltip       ),UA.szTTBTooltip       ,MirandaCP);
-    WideToAnsi(GetAttrValue(sub,ioTooltipPressed),UA.szTTBTooltipPressed,MirandaCP);
-
-    // ----- TabSRMM toolbar -----
-    sub:=GetNthChild(actnode,ioTabSRMM,0);
-    StrDupW(UA.szTabBTooltip       ,getAttrValue(sub,ioTooltip));
-    StrDupW(UA.szTabBTooltipPressed,getAttrValue(sub,ioTooltipPressed));
-
-    // ----- Menus -----
-    num:=0;
-    repeat
-      sub:=getNextChild(actnode,ioMenuItem,@num);
-      if sub=0 then break;
-
-      i:=StrToInt(getAttrValue(sub,ioType));
-      ImportMenuItems(sub,
-          UA.UAMenuItem[tMenuType(i)]);
-    until false;
-  end;
+  UA.flags:=0;
+  // ----- Common -----
+  if StrToInt(xmlGetAttrValue(actnode,ioTwoState))<>0 then
+    UA.flags:=UA.flags or UAF_2STATE;
+
+  if StrToInt(xmlGetAttrValue(actnode,ioSaveState))<>0 then
+    UA.flags:=UA.flags or UAF_SAVESTATE;
+
+  if StrToInt(xmlGetAttrValue(actnode,ioHotkey))<>0 then
+    UA.flags:=UA.flags or UAF_REGHOTKEY;
+  if StrToInt(xmlGetAttrValue(actnode,ioToolbar))<>0 then
+    UA.flags:=UA.flags or UAF_REGTTBB;
+  if StrToInt(xmlGetAttrValue(actnode,ioTabSRMM))<>0 then
+    UA.flags:=UA.flags or UAF_REGTABB;
+
+  // ----- Hotkey -----
+  // nothing
+
+  // ----- Modern CList toolbar -----
+  // source - ANSI text
+  sub:=xmlGetNthChild(actnode,ioToolbar,0);
+  WideToAnsi(xmlGetAttrValue(sub,ioTooltip       ),UA.szTTBTooltip       ,MirandaCP);
+  WideToAnsi(xmlGetAttrValue(sub,ioTooltipPressed),UA.szTTBTooltipPressed,MirandaCP);
+
+  // ----- TabSRMM toolbar -----
+  sub:=xmlGetNthChild(actnode,ioTabSRMM,0);
+  StrDupW(UA.szTabBTooltip       ,xmlGetAttrValue(sub,ioTooltip));
+  StrDupW(UA.szTabBTooltipPressed,xmlGetAttrValue(sub,ioTooltipPressed));
+
+  // ----- Menus -----
+  num:=0;
+  repeat
+    sub:=xmlGetNextChild(actnode,ioMenuItem,@num);
+    if sub=0 then break;
+
+    i:=StrToInt(xmlGetAttrValue(sub,ioType));
+    ImportMenuItems(sub,UA.UAMenuItem[tMenuType(i)]);
+  until false;
 end;
 
 function Import(fname:PWideChar;aflags:dword):integer;
@@ -139,50 +126,45 @@ begin
   BlockRead(f,res^,i);
   CloseHandle(f);
 
-  xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
-  CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
-  with xmlparser do
-  begin
-    root:=parseString(ChangeUnicode(res),@i,nil);
-    j:=0;
-    repeat
-      actnode:=getNthChild(root,ioAction,j);
-      if actnode=0 then break;
-      // search id by name?
-      pcw:=GetAttrValue(actnode,ioName);
-      ptr:=ptr1;
-      inc(pbyte(ptr),4);
-      for i:=0 to num-1 do
+  root:=xmlParseString(ChangeUnicode(res),@i,nil);
+  j:=0;
+  repeat
+    actnode:=xmlGetNthChild(root,ioAction,j);
+    if actnode=0 then break;
+    // search id by name?
+    pcw:=xmlGetAttrValue(actnode,ioName);
+    ptr:=ptr1;
+    inc(pbyte(ptr),4);
+    for i:=0 to num-1 do
+    begin
+      if (ptr.flags and ACF_SELECTED)<>0 then
       begin
-        if (ptr.flags and ACF_SELECTED)<>0 then
+        if StrCmpw(pcw,ptr.descr)=0 then
         begin
-          if StrCmpw(pcw,ptr.descr)=0 then
+          // delete old UA for overwrited actions
+          if (ptr.flags and ACF_OVERLOAD)<>0 then
           begin
-            // delete old UA for overwrited actions
-            if (ptr.flags and ACF_OVERLOAD)<>0 then
+            for act:=0 to HIGH(UActionList) do
             begin
-              for act:=0 to HIGH(UActionList) do
+              if ptr.id=UActionList[act].dwActID then
               begin
-                if ptr.id=UActionList[act].dwActID then
-                begin
-                  DeleteUAction(act,true);
-                  break;
-                end;
+                DeleteUAction(act,true);
+                break;
               end;
             end;
-            num1:=AddUAction(-1,ptr);
-            ImportUAction(getNthChild(actnode,ioUA,0),UActionList[num1]);
-            break;
           end;
+          num1:=AddUAction(-1,ptr);
+          ImportUAction(xmlGetNthChild(actnode,ioUA,0),UActionList[num1]);
+          break;
         end;
-        inc(ptr);
       end;
-      
-      inc(j);
-    until false;
+      inc(ptr);
+    end;
+    
+    inc(j);
+  until false;
+  xmlDestroyNode(root);
 
-    DestroyNode(root);
-  end;
   CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
   mFreeMem(res);
   result:=1;
@@ -197,27 +179,24 @@ end;
 
 function ExportMenuItems(node:HXML;const MenuItem:tUAMenuItem):HXML;
 begin
-  with xmlparser do
+  result:=xmlAddChild(node,ioMenuItem,nil);
+  with MenuItem do
   begin
-    result:=AddChild(node,ioMenuItem,nil);
-    with MenuItem do
-    begin
-    // popup
-      if (szMenuPopup<>nil) and (szMenuPopup^<>#0) then
-        AddAttr(result,ioMenuPopup,szMenuPopup);
-    // name
-      if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
-        AddAttr(result,ioMenuName,szMenuNameVars);
-    // show
-      if (szMenuShowWhenVars<>nil) and (szMenuShowWhenVars^<>#0) then
-        AddAttr(result,ioMenuShow,szMenuShowWhenVars);
-    // used
-      AddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
-    // separated
-      AddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
-    // no translate
-      AddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
-    end;
+  // popup
+    if (szMenuPopup<>nil) and (szMenuPopup^<>#0) then
+      xmlAddAttr(result,ioMenuPopup,szMenuPopup);
+  // name
+    if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
+      xmlAddAttr(result,ioMenuName,szMenuNameVars);
+  // show
+    if (szMenuShowWhenVars<>nil) and (szMenuShowWhenVars^<>#0) then
+      xmlAddAttr(result,ioMenuShow,szMenuShowWhenVars);
+  // used
+    xmlAddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
+  // separated
+    xmlAddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
+  // no translate
+    xmlAddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
   end;
 end;
 
@@ -229,70 +208,66 @@ var
   actnode,sub:HXML;
   UA:pMyActionItem;
 begin
-  with xmlparser do
+  for i:=0 to HIGH(UActionList) do
   begin
-    for i:=0 to HIGH(UActionList) do
+    if UActionList[i].dwActID=id then
     begin
-      if UActionList[i].dwActID=id then
+      UA:=@UActionList[i];
+      actnode:=xmlGetChildByAttrValue(root,ioAction,ioName,name);
+      if actnode=0 then break;
+      // we don't need that node as is, just it's child for UA
+      actnode:=xmlAddChild(actnode,ioUA,nil);
+
+      // ----- Common -----
+      xmlAddAttrInt(actnode,ioTwoState ,ORD((UA.flags and UAF_2STATE   )<>0));
+      xmlAddAttrInt(actnode,ioSaveState,ORD((UA.flags and UAF_SAVESTATE)<>0));
+
+      xmlAddAttrInt(actnode,ioHotkey ,ORD((UA.flags and UAF_REGHOTKEY)<>0));
+      xmlAddAttrInt(actnode,ioToolbar,ORD((UA.flags and UAF_REGTTBB )<>0));
+      xmlAddAttrInt(actnode,ioTabSRMM,ORD((UA.flags and UAF_REGTABB )<>0));
+
+      // ----- Hotkey -----
+      // nothing
+
+      // ----- Modern CList toolbar -----
+      // source - ANSI text
+      if ((UA.szTTBTooltip       <>nil) and (UA.szTTBTooltip^       <>#0)) or
+         ((UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0)) then
       begin
-        UA:=@UActionList[i];
-        actnode:=getChildByAttrValue(root,ioAction,ioName,name);
-        if actnode=0 then break;
-        // we don't need that node as is, just it's child for UA
-        actnode:=addChild(actnode,ioUA,nil);
-
-        // ----- Common -----
-        AddAttrInt(actnode,ioTwoState ,ORD((UA.flags and UAF_2STATE   )<>0));
-        AddAttrInt(actnode,ioSaveState,ORD((UA.flags and UAF_SAVESTATE)<>0));
-
-  //      sub:=AddChild(actnode,ioRegister,nil);
-        AddAttrInt(actnode,ioHotkey ,ORD((UA.flags and UAF_REGHOTKEY)<>0));
-        AddAttrInt(actnode,ioToolbar,ORD((UA.flags and UAF_REGTTBB )<>0));
-        AddAttrInt(actnode,ioTabSRMM,ORD((UA.flags and UAF_REGTABB )<>0));
-
-        // ----- Hotkey -----
-        // nothing
-
-        // ----- Modern CList toolbar -----
-        // source - ANSI text
-        if ((UA.szTTBTooltip       <>nil) and (UA.szTTBTooltip^       <>#0)) or
-           ((UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0)) then
+        sub:=xmlAddChild(actnode,ioToolbar,nil);
+        if (UA.szTTBTooltip<>nil) and (UA.szTTBTooltip^<>#0) then
         begin
-          sub:=AddChild(actnode,ioToolbar,nil);
-          if (UA.szTTBTooltip<>nil) and (UA.szTTBTooltip^<>#0) then
-          begin
-            AnsiToWide(UA.szTTBTooltip,pc,MirandaCP);
-            AddAttr(sub,ioTooltip,pc);
-            mFreeMem(pc);
-          end;
-          if (UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0) then
-          begin
-            AnsiToWide(UA.szTTBTooltipPressed,pc,MirandaCP);
-            AddAttr(sub,ioTooltipPressed,pc);
-            mFreeMem(pc);
-          end;
+          AnsiToWide(UA.szTTBTooltip,pc,MirandaCP);
+          xmlAddAttr(sub,ioTooltip,pc);
+          mFreeMem(pc);
         end;
-
-        // ----- TabSRMM toolbar -----
-        if ((UA.szTabBTooltip       <>nil) and (UA.szTabBTooltip^       <>#0)) or
-           ((UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0)) then
+        if (UA.szTTBTooltipPressed<>nil) and (UA.szTTBTooltipPressed^<>#0) then
         begin
-          sub:=AddChild(actnode,ioTabSRMM,nil);
-          if (UA.szTabBTooltip<>nil) and (UA.szTabBTooltip^<>#0) then
-            AddAttr(sub,ioTooltip,UA.szTabBTooltip);
-          if (UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0) then
-            AddAttr(sub,ioTooltipPressed,UA.szTabBTooltipPressed);
+          AnsiToWide(UA.szTTBTooltipPressed,pc,MirandaCP);
+          xmlAddAttr(sub,ioTooltipPressed,pc);
+          mFreeMem(pc);
         end;
+      end;
 
-        // ----- Menus -----
-        for lmenu:=main_menu to HIGH(tMenuType) do
-        begin
-          sub:=ExportMenuItems(actnode,UA.UAMenuItem[lmenu]);
-          AddAttrInt(sub,ioType,ORD(lmenu));
-        end;
+      // ----- TabSRMM toolbar -----
+      if ((UA.szTabBTooltip       <>nil) and (UA.szTabBTooltip^       <>#0)) or
+         ((UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0)) then
+      begin
+        sub:=xmlAddChild(actnode,ioTabSRMM,nil);
+        if (UA.szTabBTooltip<>nil) and (UA.szTabBTooltip^<>#0) then
+          xmlAddAttr(sub,ioTooltip,UA.szTabBTooltip);
+        if (UA.szTabBTooltipPressed<>nil) and (UA.szTabBTooltipPressed^<>#0) then
+          xmlAddAttr(sub,ioTooltipPressed,UA.szTabBTooltipPressed);
+      end;
 
-        break;
+      // ----- Menus -----
+      for lmenu:=main_menu to HIGH(tMenuType) do
+      begin
+        sub:=ExportMenuItems(actnode,UA.UAMenuItem[lmenu]);
+        xmlAddAttrInt(sub,ioType,ORD(lmenu));
       end;
+
+      break;
     end;
   end;
 end;
@@ -306,47 +281,43 @@ var
   ptr,ptr1:pChain;
 begin
   result:=0;
-  xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
-  CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
-  with xmlparser do
+
+  // we need append file, not rewrite
+  i:=GetFSize(fname);
+  if i=0 then exit;
+
+  mGetMem (res ,i+SizeOf(WideChar));
+  FillChar(res^,i+SizeOf(WideChar),0);
+  f:=Reset(fname);
+  BlockRead(f,res^,i);
+  CloseHandle(f);
+  root:=xmlParseString(res,@i,nil);
+  mFreeMem(res);
+
+  num:=CallService(MS_ACT_GETLIST,0,LPARAM(@ptr));
+  if num>0 then
   begin
-    // we need append file, not rewrite
-    i:=GetFSize(fname);
-    if i=0 then exit;
-
-    mGetMem (res ,i+SizeOf(WideChar));
-    FillChar(res^,i+SizeOf(WideChar),0);
-    f:=Reset(fname);
-    BlockRead(f,res^,i);
-    CloseHandle(f);
-    root:=parseString(res,@i,nil);
-    mFreeMem(res);
-
-    num:=CallService(MS_ACT_GETLIST,0,LPARAM(@ptr));
-    if num>0 then
+    ptr1:=ptr;
+    inc(pbyte(ptr),4);
+    for i:=0 to num-1 do
     begin
-      ptr1:=ptr;
-      inc(pbyte(ptr),4);
-      for i:=0 to num-1 do
+      if ((aflags and ACIO_SELECTED)=0) or
+         ((ptr.flags and ACCF_EXPORT)<>0) then
       begin
-        if ((aflags and ACIO_SELECTED)=0) or
-           ((ptr.flags and ACCF_EXPORT)<>0) then
-        begin
-          WriteUAction(root,ptr.id,ptr.descr);
-        end;
-        inc(ptr);
+        WriteUAction(root,ptr.id,ptr.descr);
       end;
-      CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
+      inc(ptr);
     end;
+    CallService(MS_ACT_FREELIST,0,LPARAM(ptr1));
+  end;
 
-    res:=toString(root,@i);
+  res:=xmlToString(root,@i);
 
-    f:=Rewrite(fname);
-    BlockWrite(f,res^,i*SizeOf(WideChar));
-    CloseHandle(f);
-    xmlparser.FreeMem(res);
-    DestroyNode(root);
-  end;
+  f:=Rewrite(fname);
+  BlockWrite(f,res^,i*SizeOf(WideChar));
+  CloseHandle(f);
+  xmlFree(res);
+  xmlDestroyNode(root);
   result:=1;
 end;
 
-- 
cgit v1.2.3