XML schema defined as follow, and suppose i have to get sal where dept="lab" and id="001".
<start>
<emp>
<dept>lab</dept>
<id>001</id>
<sex>male</sex>
<sal>5k</sal>
</emp>
</start>
another way,
<start>
<emp dept="lab">
<id sr="001">
<sex>male</sex>
<sal>5k</sal>
</id>
</emp>
</start>
I think the second way is far better to parse but it is advisable to avoid attribute, why? What do you say?