Anonymous user
XML/Output: Difference between revisions
m
{{out}}
(→{{header|PicoLisp}}: Fix typo in lib-import line) |
m ({{out}}) |
||
Line 1:
{{task|XML}}
Create a function that takes a list of character names and a list of corresponding remarks and returns an XML document of <code><Character></code> elements each with a name attributes and each enclosing its remarks
All <code><Character></code> elements are to be enclosed in turn, in an outer <code><CharacterRemarks></code> element.
As an example, calling the function with the three names of:
Line 24 ⟶ 25:
Note too that although the task is written to take two lists of corresponding data, a single mapping/hash/dictionary of names to remarks is also acceptable.
'''Note to editors:''' Program output with escaped characters will be viewed as the character on the page so you need to 'escape-the-escapes' to make the RC entry display what would be shown in a plain text viewer (See [[Talk:XML_Creation#Escaping_Escapes|this]]).
Alternately, output can be placed in <nowiki><lang xml></lang></nowiki> tags without any special treatment.
=={{header|Ada}}==
{{works with|GNAT}}
Line 368 ⟶ 371:
)
)</lang>
{{out}}
<
<CharacterRemarks><Character name="April">Bubbly: I'm > Tam and <= Emily</Character>
<Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character>
<Character name="Emily">Short & shrift</Character>
</CharacterRemarks></
=={{header|C}}==
Line 530 ⟶ 533:
"Short & shrift"))</lang>
{{out}}
<div style="width:full;overflow:scroll">
<pre><?xml version="1.0" encoding="UTF-8"?>
Line 708 ⟶ 711:
puts(1,"</CharacterRemarks>\n")</lang>
{{out}}
<
<CharacterName="April">Bubbly: I'm > Tam and <= Emily</Character>
<CharacterName="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character>
<CharacterName="Emily">Short & shrift</Character>
</CharacterRemarks>
</
=={{header|F_Sharp|F#}}==
Line 788 ⟶ 791:
</lang>
<pre>
<?xml version='1.0' encoding='UTF-8'?>
|