Function

GetXMLParamReturnValueTIU

Module

uTemplates

Last Modified

7/15/2014 3:26:44 PM

Scope

Interfaced

Declaration

function GetXMLParamReturnValueTIU(DocInfo, ParamTag: string): string;

Called-By Hierarchy


              GetXMLParamReturnValueTIU
           TfrmNotes.UpdateNoteAuthor┘ 
            TfrmNotes.InsertNewNote┤   
         TfrmNotes.mnuActNewClick┤ │   
      TfrmNotes.cmdNewNoteClick┘ │ │   
  TfrmNotes.mnuActAddIDEntryClick┘ │   
                   AssignBoilerText┤   
  TfrmNotes.mnuActLoadBoilerClick┘ │   
       TfrmNotes.cmdChangeClick┘   │   
   TfrmNotes.InsertNewNote...┤     │   
     TfrmNotes.InsertAddendum┤     │   
TfrmNotes.mnuActAddendClick┘ │     │   
        TfrmNotes.LoadForEdit┤     │   
  TfrmNotes.mnuActEditClick┘ │     │   
  TfrmNotes.mnuActChangeClick┤     │   
TfrmNotes.UpdateNoteAuthor...┘     │   
 TfrmNotes.mnuActLoadBoilerClick...┘   

Called-By

Name Declaration Comments
TfrmNotes.UpdateNoteAuthor procedure UpdateNoteAuthor(DocInfo: string); -


Source

2854  function GetXMLParamReturnValueTIU(DocInfo, ParamTag: string): string;
2855  var
2856    XMLDoc: IXMLDOMDocument;
2857    RootElement: IXMLDOMElement;
2858    TagElement: IXMLDOMNode;
2859  const
2860    NoIE5 = 'You must have Internet Explorer 5 or better installed to %s Templates';
2861    NoIE5Header = 'Need Internet Explorer 5';
2862    TIUHeader = 'TIU_DOC';
2863  begin
2864  //  After ExecuteTemplateOrBoilerPlate, DocInfo parameter may contain return value of AUTHOR.
2865  //  Call this function at that point to get the value from the XML formatted parameter that's returned.
2866    Result := '';
2867    try
2868      XMLDoc := CoDOMDocument.Create;
2869    except
2870      InfoBox(Format(NoIE5, ['use COM']), NoIE5Header, MB_OK);
2871      exit;
2872    end;
2873    try
2874      if assigned(XMLDoc) then
2875      begin
2876        XMLDoc.preserveWhiteSpace := TRUE;
2877        if DocInfo <> '' then
2878          XMLDoc.LoadXML(DocInfo);
2879        RootElement := XMLDoc.DocumentElement;
2880        if not assigned(RootElement) then exit;
2881        try
2882          if(RootElement.tagName <> TIUHeader) then exit
2883          else
2884            begin
2885              TagElement := FindXMLElement(RootElement, ParamTag);
2886              if assigned(TagElement) then
2887                Result := TagElement.Text
2888              else Result := '';
2889            end;
2890        finally
2891          TagElement := nil;
2892          RootElement := nil;
2893        end;
2894      end;
2895    finally
2896      XMLDoc := nil;
2897    end;
2898  end;