After searching around, I know the difference in syntax between an attribute and an element.
I'm not asking wether I should use which, but if they are interpreted the same by e.g a server.
On w3schools.com, it says the following examples "contain exactly the same information";
<!-- document A using an attribute -->
<note date="2008-01-10">
<to>Tove</to>
<from>Jani</from>
</note>
<!-- document B using an element -->
<note>
<date>2008-01-10</date>
<to>Tove</to>
<from>Jani</from>
</note>
My question is, "Are the two documents supposed to be 'exchangable' ?"
i.e, A server is expecting document format A, but receives document B. Will the server be 'obliged' to parse and accept document B by xml standards ?
No, the two documents are not interchangeable. The XML Schema in use, which must be agreed upon between the server and the client, defines the possible attributes and the possible sub-elements of each element type. These are two distinct sets.
It's true that in the case of a datum which does not have internal structure, either an attribute or a sub-element could be used to transmit the information.But that's a decision the schema developer needs to make. An important thing that needs to be taken into account in making this decision is whether or not the datum has internal structure. At their most complicated, attributes can be lists of tokens. (Or microsyntaxes, such as your date.) Sub-elements, on the other hand, can be arbitrarily rich in structure. So they only "contain the same information" to the extent that the information they contain is not very complicated.