xsd - Add an attribute or create a new level in the XML hierarchy? -


i working on xml document written xml hierarchy 2 levels. right now, want add one-to-many categorization break of code works file.

i either add categorization new level, or can implement attribute on same level (almost tagging).

current:

<category>     <subcategory></subcategory> <category> 

proposed:

<supercategory>     <category>         <subcategory></subcategory>     </category> </supercategory> 

or:

<category supercategory="">     <subcategory></subcategory> </category> 

which method more maintainable?

to me, 1 of strengths of xml hierarchical nature of xml elements ideally suited describing hierarchical arrangements of objects, such in case. such, tend prefer first option, xml structure more resembles structure of data. makes easier read, manage , understand, imho.

that said, can if effort required make work existing codebase worth it. there's nothing stopping doing second way if think required modifications difficult/time consuming, don't think elegant solution.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -