Which is the best way the search and locate the xml node?



I am planning to create an XML schema for storing data. XPath query can be used to read the data based on node name and attribute. Which is the best way to define the schema, so that my XML reader will performance will be good?


Type 1:



<State Name="CA">
<VehicleType Name="TwoWheeler">
...
</VehicleType>
<VehicleType Name="FourWheeler">
...
</VehicleType>
<VehicleType Name="WaterCraft">
...
</VehicleType>


Type 2:



<CA>
<TwoWheeler>
....
</TwoWheeler>
<FourWheeler>
.....
</FourWheeler>
<WaterCraft>
.....
</WaterCraft>

No comments:

Post a Comment