Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
46
Task/XML-Output/Yabasic/xml-output.basic
Normal file
46
Task/XML-Output/Yabasic/xml-output.basic
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
sign$ = "<,<,>,>,&,&"
|
||||
dim sign$(1)
|
||||
long = token(sign$, sign$(), ",")
|
||||
|
||||
sub substitute_all$(s$)
|
||||
local i
|
||||
|
||||
for i = 1 to long step 2
|
||||
if s$ = sign$(i) return sign$(i + 1)
|
||||
next i
|
||||
return s$
|
||||
end sub
|
||||
|
||||
sub xmlquote_all$(s$)
|
||||
local i, res$
|
||||
|
||||
for i = 1 to len(s$)
|
||||
res$ = res$ + substitute_all$(mid$(s$, i, 1))
|
||||
next i
|
||||
return res$
|
||||
end sub
|
||||
|
||||
sub xml_CharacterRemarks$(datos$())
|
||||
local res$, i, long
|
||||
|
||||
long = arraysize(datos$(), 1)
|
||||
|
||||
res$ = "<CharacterRemarks>\n"
|
||||
|
||||
for i = 1 to long
|
||||
res$ = res$ + " <CharacterName=\"" + xmlquote_all$(datos$(i, 1)) + "\">" + xmlquote_all$(datos$(i, 2)) + "</Character>\n"
|
||||
next i
|
||||
return res$ + "</CharacterRemarks>\n"
|
||||
end sub
|
||||
|
||||
data "April", "Bubbly: I'm > Tam and <= Emily"
|
||||
data "Tam O'Shanter", "Burns: \"When chapman billies leave the street ...\""
|
||||
data "Emily", "Short & shrift"
|
||||
|
||||
dim testset$(3, 2)
|
||||
|
||||
for i = 1 to 3
|
||||
read testset$(i, 1), testset$(i, 2)
|
||||
next i
|
||||
|
||||
print xml_CharacterRemarks$(testset$())
|
||||
Loading…
Add table
Add a link
Reference in a new issue