Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
33
Task/XML-Output/Phix/xml-output.phix
Normal file
33
Task/XML-Output/Phix/xml-output.phix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
constant {hchars,hsubs} = columnize({{"<","<"},
|
||||
{">",">"},
|
||||
{"&","&"},
|
||||
{"\"","""},
|
||||
{"\'","'"}})
|
||||
function xmlquote_all(sequence s)
|
||||
for i=1 to length(s) do
|
||||
s[i] = substitute_all(s[i],hchars,hsubs)
|
||||
end for
|
||||
return s
|
||||
end function
|
||||
|
||||
function xml_CharacterRemarks(sequence data)
|
||||
string res = "<CharacterRemarks>\n"
|
||||
for i=1 to length(data) do
|
||||
res &= sprintf(" <CharacterName=\"%s\">%s</Character>\n",xmlquote_all(data[i]))
|
||||
end for
|
||||
return res & "</CharacterRemarks>\n"
|
||||
end function
|
||||
|
||||
constant testset = {
|
||||
{"April", "Bubbly: I'm > Tam and <= Emily"},
|
||||
{"Tam O'Shanter", "Burns: \"When chapman billies leave the street ...\""},
|
||||
{"Emily", "Short & shrift"}
|
||||
}
|
||||
printf(1,xml_CharacterRemarks(testset))
|
||||
|
||||
-- Sample output:
|
||||
-- <CharacterRemarks>
|
||||
-- <CharacterName="April">Bubbly: I'm &gt; Tam and &lt;= Emily</Character>
|
||||
-- <CharacterName="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character>
|
||||
-- <CharacterName="Emily">Short & shrift</Character>
|
||||
-- </CharacterRemarks>
|
||||
Loading…
Add table
Add a link
Reference in a new issue