Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
77
Task/XML-Output/Action-/xml-output.action
Normal file
77
Task/XML-Output/Action-/xml-output.action
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
DEFINE PTR="CARD"
|
||||
DEFINE CHARACTER_SIZE="4"
|
||||
TYPE Character=[PTR name,remark]
|
||||
|
||||
PTR FUNC GetCharacterPointer(BYTE ARRAY d INT index)
|
||||
RETURN (d+index*CHARACTER_SIZE)
|
||||
|
||||
PROC SetCharacter(BYTE ARRAY d INT index CHAR ARRAY n,r)
|
||||
Character POINTER ch
|
||||
|
||||
ch=GetCharacterPointer(d,index)
|
||||
ch.name=n
|
||||
ch.remark=r
|
||||
RETURN
|
||||
|
||||
PROC PrintEscaped(CHAR ARRAY s)
|
||||
INT i
|
||||
CHAR c
|
||||
|
||||
FOR i=1 TO s(0)
|
||||
DO
|
||||
c=s(i)
|
||||
IF c='< THEN
|
||||
Print("<")
|
||||
ELSEIF c='> THEN
|
||||
Print(">")
|
||||
ELSEIF c='& THEN
|
||||
Print("&")
|
||||
ELSE
|
||||
Put(c)
|
||||
FI
|
||||
OD
|
||||
RETURN
|
||||
|
||||
PROC OutputNode(CHAR ARRAY node,tagName,tagValue BYTE closing)
|
||||
Put('<)
|
||||
IF closing THEN Put('/) FI
|
||||
Print(node)
|
||||
IF tagName(0)>0 THEN
|
||||
PrintF(" %S=""",tagName)
|
||||
PrintEscaped(tagValue) Put('")
|
||||
FI
|
||||
Put('>)
|
||||
RETURN
|
||||
|
||||
PROC OutputCharacter(Character POINTER ch)
|
||||
CHAR ARRAY node="Character"
|
||||
|
||||
OutputNode(node,"name",ch.name,0)
|
||||
PrintEscaped(ch.remark)
|
||||
OutputNode(node,"","",1)
|
||||
RETURN
|
||||
|
||||
PROC OutputCharacters(BYTE ARRAY d INT count)
|
||||
CHAR ARRAY node="CharacterRemarks"
|
||||
Character POINTER ch
|
||||
INT i
|
||||
|
||||
OutputNode(node,"","",0) PutE()
|
||||
FOR i=0 TO count-1
|
||||
DO
|
||||
ch=GetCharacterPointer(d,i)
|
||||
OutputCharacter(ch) PutE()
|
||||
OD
|
||||
OutputNode(node,"","",1) PutE()
|
||||
RETURN
|
||||
|
||||
PROC Main()
|
||||
BYTE count=[3]
|
||||
BYTE ARRAY d(12)
|
||||
|
||||
SetCharacter(d,0,"April","Bubbly: I'm > Tam and <= Emily")
|
||||
SetCharacter(d,1,"Tam O'Shanter","Burns: ""When chapman billies leave the street ...""")
|
||||
SetCharacter(d,2,"Emily","Short & shrift")
|
||||
|
||||
OutputCharacters(d,count)
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue