News for hackers. Stuff that matters.
Re:XML: Contrary to popular belief, it doesn't always kill b... by nivertech on Saturday February 19, 2011 @06:47PM (#2240325)
For somebody who want to make XML shorter and more human-readable:

1. Use more attributes, i.e.:

  <employee first="Steve" last="Jobs/>
instead of

  <employee>
     <first>Steve</first>
     <last>Jobs</last>
  </employee>
2. Use Camel case instead of '_', i.e.:

  <MyElementName>XXX</MyElementName>
instead of:

  <my_element_name>XXX</my_element_name>

3. Use sane namespace prefixes.

4. Write XSD schema (or generate it from example XML document) - Tools like XMLSpy really helpfull in filling complex XMLs.

Re:XML: Contrary to popular belief, it doesn't always kill b... by cperciva on Saturday February 19, 2011 @10:33PM (#2240898)
Some of us find unix_style names far more readable than CamelCase. Underscores are almost spaces and make it much easier to recognize where each word starts.
Re:XML: Contrary to popular belief, it doesn't always kill b... by nailer on Sunday February 20, 2011 @04:21AM (#2241499)
Wouldn't unix style be uxixstyle?
Re:XML: Contrary to popular belief, it doesn't always kill b... by Groxx on Saturday February 19, 2011 @06:50PM (#2240331)
1 is a good example of something I see people doing wrong with XML on a regular basis. If there can't be a list of items, it should be an attribute, not a node.
Re:XML: Contrary to popular belief, it doesn't always kill b... by nivertech on Saturday February 19, 2011 @06:56PM (#2240349)
Actually it's abuse of attributes, since attributes must be metadata only, while data itself should be in element content. But it makes large XML files much more readable ...
Re:XML: Contrary to popular belief, it doesn't always kill b... by Groxx on Saturday February 19, 2011 @06:58PM (#2240354)
Only because you don't tend to find XML tidiers that display like this:

  <node_name
    attr="value"
    attr2="value2">
always this:

  <node_name attr="value" attr2="value2" etc="etc" ad="infinitum" until="you have to scroll">
edit:

On a <person>, how do you define what's data and what's metadata? Is a name data or metadata? What's the difference between data and metadata in the first place, in a concrete, testable definition? Google define:metadata says:

  data about data; "a library catalog is metadata because it describes publications"
So a library catalog should be like this?

  <library name="of congress"
    978_3_16_148410_0="<data title=\"\">contents</data>" 
    978_3_16_148410_1="<data title=\"\">contents</data>"
    etc >
(intentionally reducto-ad-absurdum)