XML Nodes Versus XML Attributes

Decided to speak about this as found that many developers are misusing XML nodes and XML attributes.

In my opinion node should be used only in case if it can have attributes. In this case XML
[code]
[Authors]
[Author]
[Name]Paulo[/Name]
[SurName]Coelho[/SurName]
[/Author]
[/Authors]
[/code]

Should be redesigned into XML
[code]
[Authors]
[Author Name=”Paulo” SurName=”Coelho”/]
[/Authors]
[/code]
I faced some XML structures like
[code]
[root][veryveryverylongnodename]1[/veryveryverylongnodenam][/root]
[/code]
I think this is ridiculous …

Leave a Reply