Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/XML-Output/XPL0/xml-output.xpl0
Normal file
30
Task/XML-Output/XPL0/xml-output.xpl0
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
code ChOut=8, CrLf=9, Text=12;
|
||||
string 0; \use zero-terminated strings
|
||||
|
||||
proc XmlOut(S); \Output string in XML format
|
||||
char S;
|
||||
repeat case S(0) of \character entity substitutions
|
||||
^<: Text(0, "<");
|
||||
^>: Text(0, ">");
|
||||
^&: Text(0, "&");
|
||||
^": Text(0, """);
|
||||
^': Text(0, "'")
|
||||
other ChOut(0, S(0));
|
||||
S:= S+1;
|
||||
until S(0) = 0;
|
||||
|
||||
int Name, Remark, I;
|
||||
[Name:= ["April", "Tam O'Shanter", "Emily"];
|
||||
Remark:= ["Bubbly: I'm > Tam and <= Emily",
|
||||
"Burns: ^"When chapman billies leave the street ...^"",
|
||||
"Short & shrift"];
|
||||
Text(0, "<CharacterRemarks>"); CrLf(0);
|
||||
for I:= 0 to 3-1 do
|
||||
[Text(0, " <Character name=^"");
|
||||
XmlOut(Name(I));
|
||||
Text(0, "^">");
|
||||
XmlOut(Remark(I));
|
||||
Text(0, "</Character>"); CrLf(0);
|
||||
];
|
||||
Text(0, "</CharacterRemarks>"); CrLf(0);
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue