Talk:XML/Input: Difference between revisions

Content added Content deleted
(If you convert characters when not requested, your program has a bug.)
Line 16: Line 16:
:::::::: Kevin, why not simply add a requirement that everybody must use your favorite language? No, there is no point creating tasks that require using some specific language or library. The tasks should require solving some specific problem. That is what programming languages are used for in the real world. The requirements of "conformant XML parser" have nothing to do with Rosetta Code tasks, and not with real world problems either. It is the '''customer''' who sets the requirements. If the task is to extract student names from an XML file, then a program that extracts students names is the correct solution. There is nothing "misleading" or "half baked" in a correct solution that performs the required tasks. "Processing" character references has nothing to do with this task. When the task is to extract the data, the character references have to be extracted just like any other characters, there is nothing to process. --[[User:PauliKL|PauliKL]] 07:54, 3 June 2009 (UTC)
:::::::: Kevin, why not simply add a requirement that everybody must use your favorite language? No, there is no point creating tasks that require using some specific language or library. The tasks should require solving some specific problem. That is what programming languages are used for in the real world. The requirements of "conformant XML parser" have nothing to do with Rosetta Code tasks, and not with real world problems either. It is the '''customer''' who sets the requirements. If the task is to extract student names from an XML file, then a program that extracts students names is the correct solution. There is nothing "misleading" or "half baked" in a correct solution that performs the required tasks. "Processing" character references has nothing to do with this task. When the task is to extract the data, the character references have to be extracted just like any other characters, there is nothing to process. --[[User:PauliKL|PauliKL]] 07:54, 3 June 2009 (UTC)
::::::::: If your job required you to extract names from XML, and your solution didn't handle the gamut of XML possibilities (for instance, translating either "&#x00C9" or "É" to É), you'd eventually have your code sent back with a bug. Let's not have buggy code on this site; folks are coming here to see best-practice in programming languages, not ad-hoc hackery. --[[User:IanOsgood|IanOsgood]] 15:01, 3 June 2009 (UTC)
::::::::: If your job required you to extract names from XML, and your solution didn't handle the gamut of XML possibilities (for instance, translating either "&#x00C9" or "É" to É), you'd eventually have your code sent back with a bug. Let's not have buggy code on this site; folks are coming here to see best-practice in programming languages, not ad-hoc hackery. --[[User:IanOsgood|IanOsgood]] 15:01, 3 June 2009 (UTC)
:::::::::: '''Wrong'''. If the job requires to extract names from XML, a program that extracts names from XML is exactly the correct solution. It does ''not'' have a bug. In fact, if you ''do'' the conversion when that is not requested, ''then'' your program has a bug and the customer will complain. Why on earth should the characters be converted? And converted to what? UTF-8? UTF-16? ISO 8859-1? If numerical references are used, there is a reason for that, so they must not be converted to something else when such conversion is not requested. --[[User:PauliKL|PauliKL]] 16:27, 3 June 2009 (UTC)
::Donal, the problem is that AWK implementation does not interpret the structure at all. It is quite possible to do some parsing even if there are no ready-made library routines for that. But that does not mean that we should implement a full XML parser. The task should be kept relatively simple.
::Donal, the problem is that AWK implementation does not interpret the structure at all. It is quite possible to do some parsing even if there are no ready-made library routines for that. But that does not mean that we should implement a full XML parser. The task should be kept relatively simple.
::I notice that the XML input file has now been changed. But the the task description needs to be changed, too. --[[User:PauliKL|PauliKL]] 09:14, 2 June 2009 (UTC)
::I notice that the XML input file has now been changed. But the the task description needs to be changed, too. --[[User:PauliKL|PauliKL]] 09:14, 2 June 2009 (UTC)