Hi all,
Really appreciate the discuss here, my incoming project will use XML intensively, but I have no experience in dealing with Chinese characters in XML, so I hope the discussion continue and I will benefit from it.
But put aside Chinese related issues, I think Banq's statement about attribute vs. element are biased. Yes, there are obvious advantage of using element: use of <!{CDATA[; specify data type and NULL if you are using Schema etc.
But there are also lots of benefit of using attribute:
1> namespace, unless you are using W3c schema, you have to becare to keep name unqiue as that's required in DTD
2> if you have a text be a element, you can only declare "ANY" if you want to extend it for sub element
3> performance, if you understand how DOM works, parsing more node will slow down processing
I was also struggling about attr vs. element when I started to use XML, my personal perference now is still try to use attr if it's straight forward basic data, text, integer,whatever
One time I was going to switch to element as I was using JAXB to automate the JAVA to XML binding, but then I realize that most of time I don't have to bother to deal with JAXB crap, JDOM is good enough and simple for most of my work.
my $0.02
-Wanchun