Talk:XML/Output: Difference between revisions

Suggested modification of Task
(task description already demands encoding wherever possible / use standard input instead of file for names)
(Suggested modification of Task)
Line 13:
It would make more sense if the task would be for example to read list of names from a text file and use it to create an XML file with specified structure. In that case it would make sense to to require converting special characters into entities, since such special characters might exist in the input file. In order to compare the output, you could then have an example input file. --[[User:PauliKL|PauliKL]] 11:48, 8 June 2009 (UTC)
: Instead of reading from a file, just get it from standard input (or more generally, "from the user"). That way, the task doesn't get cluttered with file system stuff unrelated to this task. --[[User:Ce|Ce]] 11:54, 8 June 2009 (UTC)
 
==Modification of Task==
I suggest the task be changed to adress some of the issues discussed above. I would suggest the following
 
 
----
 
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:
"April", "Tam O'Shanter", and "Emily".
And remarks of:
'Bubbly: I\'m > Tam and <= Emily'
'Burns: "When chapman billies leave the street ..."'
and 'Short & shrift'
 
Should produce the XML:
<Characters>
<Character name="April">Bubbly: I'm &gt; Tam and &lt;= Emily</Character>
<Character name="Tam O&apos;Shanter">Burns: "When chapman billies leave the street ..."</Character>
<Character name="Emily">Short &amp; shrift</Character>
</Characters>
 
 
Note: the example is chosen to also show correct escaping of XML strings
 
--[[User:Paddy3118|Paddy3118]] 07:14, 9 June 2009 (UTC)
Anonymous user