3 ms·
Maybe I don't understand something about xml. As in, best practices. When designing an xml schema, When are you supposed to use innertext, when are you suppos
by dnautics 6y ago
Maybe I don't understand something about xml. As in, best practices. When designing an xml schema, When are you supposed to use innertext, when are you supposed to use a tag inside your tag, and when are you supposed to use a tag property?
- xapata 6y agoFirst, consider whether someone will ever want to convert to JSON. If so, make that easy.
- dnautics 6y agoit's sad that this is downvoted, since it's also true. For example, AWS emits its response as XML, and it's a chore for boto to convert that to a json response. If you don't want to use boto (say you're not in python) and you prefer getting the response in json, you might be out of luck.
- ZeroClickOk 6y agoMag property is mostly for metadata, but it does not stop it to use it for this purpose. All three options are valid and you can use as will, xml is flexible enough in this point (unless your xml consumer has some restriction, then follow the consumer spec)
- roel_v 6y agoQuite often it just doesn't matter that much. It's a matter of 'taste', as are so many things that are 'designed'. And yes you'll make mistakes a few times. The correct response to those mistakes is to take them as learning opportunities and not dwell on them, instead of blaming and trying to replace the tools. Of course one can use this exact argument to stave off any change ever...