Click here to Skip to main content
15,910,009 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,everyone! I have written a XML like below,but I think it is not good and I want to change it:
XML
<Height>
  <Standard4721>
  <PN PN="1.6">
  <A DN="250">300</A>
  <A DN="350">400</A>
  <A DN="450">500</A>
  </PN>
  <PN PN="2.5">
  <A DN="250">300</A>
  <A DN="350">400</A>
  <A DN="450">500</A>
  </PN>
  </Standard4721>
</Height>


Could you give me some suggestions about how to make it better?Thank you very much!
Posted

Not sure what you mean by "better". It's also hard to tell from context what your XML is supposed to represent, though that in itself could be a good indicator of an improvement you could make. That is, make your XML more self-explanatory. What does "PN" stand for? And what does "A" stand for? And "DN"? Also, I see that the three A's you have in the first PN look identical to the A's in the second PN... perhaps this is an indicator that you could structure it differently to remove this duplication (though, maybe not).

Also, you should typically indent XML for readability. So, the A's should all be indented another level. And what is the "4721" for? Why not put that as an attribute of the node rather than make it part of the node name? Without knowing more, that's really all the advice I can give you.
 
Share this answer
 
Comments
Tarun.K.S 29-Oct-10 10:39am    
nice suggestion!
Well that is very hard to answer.

What does your xml represent? Define better? Better in structure or definition? With out looking more it simply is not feasible to give any suggestion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900