Anonymous user
Talk:XML/Output: Difference between revisions
→Modification of Task: try to make the task clearer
(→Modification of Task: try to make the task clearer) |
|||
Line 22:
Create a function that takes a list of character names and a list of corresponding remarks and returns an XML doccument of <Character> elements each with a name attributes and surrounding their remarks. All <Character> elements are to be enclosed in an outer <Characcters> element.
As an example, calling the function with names of: “<code>April</code>”, “<code>Tam O'Shanter</code>”, and “<code>Emily</code>” and remarks of:
and “Short & shrift”</pre>
▲ 'Bubbly: I\'m > Tam and <= Emily'
Should produce the XML (modulo line breaks):▼
▲ 'Burns: "When chapman billies leave the street ..."'
<Character name="Tam O&apos;Shanter"
▲Should produce the XML:
▲ <Characters>
<Character name="
▲ <Character name="Tam O'Shanter">Burns: "When chapman billies leave the street ..."</Character>
▲ <Character name="Emily">Short & shrift</Character>
▲ </Characters>
Note: the example is chosen to also show correct escaping of XML strings
|