-
Notifications
You must be signed in to change notification settings - Fork 0
/
XMLMAKE.PAS
54 lines (43 loc) · 1.17 KB
/
XMLMAKE.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2023
@website(https://www.gladir.com/CODER/XMLLIB-TP)
@abstract(Target: Turbo Pascal 7, Free Pascal 3.2)
}
Unit XMLMAKE;
INTERFACE
Procedure BeginTag(Var F:Text;TagName:String);
Function CloseXML(Var F:Text):Boolean;
Function CreateXML(Var F:Text;FileName:String):Boolean;
Procedure EndTag(Var F:Text;TagName:String);
Procedure WriteDataTag(Var F:Text;Value:String);
Procedure WriteTag(Var F:Text;TagName,Value:String);
IMPLEMENTATION
Function CreateXML(Var F:Text;FileName:String):Boolean;
Var
R:Boolean;
Begin
{$I-}Assign(F,FileName);
Rewrite(F);{$I+}
R:=IOResult=0;
CreateXML:=R;
If(R)Then Begin
WriteLn(F,'<?xml version="1.0" encoding="UTF-8"?>');
End;
End;
Procedure BeginTag(Var F:Text;TagName:String);Begin
Write(F,'<',TagName,'>');
End;
Procedure WriteDataTag(Var F:Text;Value:String);Begin
Write(F,Value);
End;
Procedure WriteTag(Var F:Text;TagName,Value:String);Begin
WriteLn(F,'<',TagName,'>',Value,'</',TagName,'>');
End;
Procedure EndTag(Var F:Text;TagName:String);Begin
WriteLn(F,'</',TagName,'>');
End;
Function CloseXML(Var F:Text):Boolean;Begin
Close(F);
CloseXML:=IOResult=0;
End;
END.