Norkevicius

July 11, 2007

XML Nodes Versus XML Attributes

Filed under: Side Notes, XML — aurimas.norkevicius @ 11:09 am

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

[Authors]
[Author]
[Name]Paulo[/Name]
[SurName]Coelho[/SurName]
[/Author]
[/Authors]

Should be redesigned into XML

[Authors]
[Author Name="Paulo" SurName="Coelho"/]
[/Authors]

I faced some XML structures like

[root][veryveryverylongnodename]1[/veryveryverylongnodenam][/root]

I think this is ridiculous …

Powered by WordPress