News for hackers. Stuff that matters.
Re:XML is almost always misused by progval on Tuesday October 29, 2019 @04:28PM (#21391611)
That's not a good way to express a dictionary because it does not allow arbitrary strings as key names.

It's also not a good example of XML, because XML schemas should have a fixed list of tag names.

Re:XML is almost always misused by sorenjan on Tuesday October 29, 2019 @05:13PM (#21392094)
But the starting point in the example was

    <item name="name" value="John" />  
    <item name="city" value="London" />  
where the key names are used as attributes, so it wouldn't work with arbitrary key names either, right?
Re:XML is almost always misused by progval on Tuesday October 29, 2019 @05:22PM (#21392189)
It would work (kind of); most XML parsers/generators would take care of escaping and unescaping quotes; but there's no way in the XML spec to escape characters in tag names.
Re:XML is almost always misused by mpweiher on Tuesday October 29, 2019 @04:38PM (#21391716)
XML allows arbitrary strings as key names just fine.
Re:XML is almost always misused by progval on Tuesday October 29, 2019 @04:40PM (#21391740)
No, you can't have quotes, spaces, etc., because with GGP's scheme it would be a tag name, and these are invalid in tag names.