Sunday, July 06, 2008

XML Best Practices

  • Always provide an XSD for validation, code-completion and auto-generation of XML
  • Do not use elements that only contain attributes as they are difficult to parse and extend
  • Always declare the character encoding and use UTF-8 unless there is a good reason why not
  • Use structures instead of delimiting fields within elements
  • Wrap repeated elements in parents to make them more human-readable
  • Do not repeat element names in different contexts
  • Do not unnecessarily abbreviate element and attribute names
See: http://java.dzone.com/articles/crimes-against-xml

No comments: