Talk:XML/Output: Difference between revisions
Content added Content deleted
(→Modification of Task: try to make the task clearer) |
|||
Line 22: | 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. |
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: |
As an example, calling the function with names of: “<code>April</code>”, “<code>Tam O'Shanter</code>”, and “<code>Emily</code>” and remarks of: |
||
⚫ | |||
"April", "Tam O'Shanter", and "Emily". |
|||
⚫ | |||
And remarks of: |
|||
and “Short & shrift”</pre> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
and 'Short & shrift' |
|||
⚫ | |||
<Character name="Tam O&apos;Shanter" |
|||
⚫ | |||
⚫ | |||
⚫ | |||
<Character name=" |
<Character name="Emily">Short &amp; shrift</Character> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Note: the example is chosen to also show correct escaping of XML strings |
Note: the example is chosen to also show correct escaping of XML strings |