Quick XML survey

Comments (23) | Views (366)

Please help one of my RIT classmates by answering his one-question XML survey. Cheers!

Update: Although I welcome any discussion about this topic in the comments, if you plan to take the short survey please wait until after you respond to read the comments. I wouldn't want anything that anyone says about it to influence your answer.


Surprised at how close that survey is.


Aye, me too.

I am definitely on the side of elements over attributes. While using attributes yields much tighter data, XML that consists of mostly elements is much easier to glance at and see pretty quickly the structure and content of the document. Also, I've found manipulating XML with code is a bit more involved when working with attributes.


I hope you dont mind, jay, but in this case I voted for attributes. It was short piece and did not ask general opinion of which way is "better programming".


=) Of course I don't mind.
It is a question about what is easier to read, and there are no wrong answers. ;)


had to be elements. i learnt to mod with an element based game and it just seems easier to look at


Thanks for posting this, Jay. I was having some small issues w/updating some features and hadn't planned on such a great response rate, so if anything weird happened it should be fixed now =)


wow 50/50


Interesting that the question is about "easiest to read". I bet if a single 'record' in attribute style had to span different lines you'd get a different balance.


I thought the element based code was easier to understand, but the attribute code would be better for longer entries.


Difficult to choose. I actually find them equally readable. In the end I leaned slightly towards attribute. It would be interesting to try the same survey with a larger piece of code, with more attributes.

twistofreality January 29, 2006 10:29 PM

I agree that I think the survey would have different results if one or more of the elements had several more attributes. Can someone enlighten us regarding the details of the survey? It very well may be true that, "Attribute-based XML is easier to read than element-based XML when elements have few attributes," but that does not in any way validate that, "Attribute-based XML is easier to read than element-based XML." I just wrapped up a statistics class, so the particulars (hypothesis, population, etc.) would be of some interest to me and, I'd imagine, some other of this site's visitors.

In any case, glad we could help with the survey!


I can clear up a few things as per your request.

The reason I made it short is because I didn't want any reading fatigue to become a reason why people would vote for one over the other. If I put out long chunks of XML, I was concerned that they would get through whichever was the first and not care about the second.

They were short because it presented the basic functionality of each type and I didn't feel that length would necessarily demonstrate the legibility any more than a short example. All I wanted was for people to see how each one is presented, gain a good idea, and then make a quick decision on the legibility of it.

Also, the realistic scenario may or may not be that more or less attributes exist. I, again, wanted to show the basic framework without an information overload.

All of the points discussed here are valid, don't get me wrong. I would love to make corrections, but as there are now quite a few people (570+ at this point :) and making those corrections would skew the data.

The entire point of this survey is an assignment for a grad class I'm in that evaluates, quite possibly obviously, the differences - including positives and negatives - of attribute vs. element-based XML. I also plan on measuring parse times for large XML files of both attribute-style and element-style documents in JavaScript to see time differences and which is faster.

The conclusion of the project will be a lab paper about the comparisons between the two and the tests used to compare them. If you have some more questions, I'd be happy to answer them. I plan on posting a link to the paper once I've written it so anyone can feel like following up if it so interests them =)

Thanks again to all of you for taking the survey, it's giving me a lot of interesting data to work with and these comments are also helpful and, as long as no one outrightly objects, I may quote them in my paper with attribution. I'll keep everyone up to date just for the sake of it =)


As others have said, i think the short length of the sample doesn't really help out this survey. In just *this* example I think they're both equally readable. However when attribute based xml starts spanning multiple lines it (at least to me) starts to look like a large blob of text. I have trouble finding the elements that i'm looking for. That said, i rarely read that much xml, it's for the computer to use, not me, if it parses 20% faster, then i'd be all for it.


Let's keep in mind that I am a computer retard, but neither one of those meant jack squat to me.

twistofreality January 30, 2006 6:13 AM

Brendyn-- I've never worked much with XML, but your paper sounds really fascinating. I started to learn it once a while ago, but it got superceded by other things. I'll most likely pick it up again in the no too distant future, though, so that type of analysis will most certainly help if I ever have to choose a coding style. Maybe Jay would be willing to post a link to the paper somewhere on the main page when the paper's completed? I doubt I'll think to check back to these comments periodically to see if it's done. Thanks for all of the information!


Woooow I seriously am surprised, too. I always opt for one-liners in describing things so I keep the info together and can find it easier. Keeps it clean, too. Of course, it drives some programming people nuts trying to get through it, but it seems to make sense to me (my Java teacher hated me). I kinda keep in mind, though, that the people that it actually did make sense to were born networkers, like me, and seemed to prefer the same style. Scientifically it may not have too much to do with it, but at least it's an excuse ("shush, I don't care if you don't like it, I'm not a programmer"). ~lol~

But dang, in over 950 people, it's 50-50. Eye-opening. =)


Attribute, I find, is much easier to read than Element-based XML; however, I would find the element format much easier to code in (thanks to its logical outline-like hierarchy).

Based on the literal phrasing of the survey's question, I voted that Attribute-based XML is (by far) easier to read.


It depends somewhat on what you are reading for. IE, if I wanted to quickly see what the overall structure of the document was, the attribute version would be easier. But if I was quickly scanning through the text for giraffes, I'd find the element version easier.

Personally I think XML is horribly ugly and difficult to read regardless of how it's structured. Mostly this is because there is no sensible way to ident it. I think things like json and yaml are big improvements as far as readablity, especially for relatively simple data.


Attributes all the way. Especially when using serialization under .NET, writing for attributes is about as easy as writing for elements, and if you are WRITING the xml, it is much more intuitive.

Personally, I tend to use elements when I am creating detailed or mostly independant subobjects, and obviously for lists; for instance:





I find that the above is far more tedious both to read and to write, and when the objects get more complex, even good indentation is not always enough to really make it clear what's happening. For that reason, attributes can simplify the structure significantly:


Elements - maybe I've been doing this too long, but they virtually jump off the page and tell you what's going on - I really need to concentrate to read the attributes. I'd be interested to hear how this compares with how they parse though, after all I'm not the intended audience for an XML file (well not normally at any rate).


Hi all,

For those that are interested, I posted a link to the write-up (pdf) on the survey page (and also closed down the survey). Cheers!


636 found Element-style XML to be more legible while 637 liked attributes. So, yes, my vote was important, now we have scientific proof that elements are bad and should be abandoned and attributes are way to go :)

twistofreality January 31, 2006 4:44 PM

Interesting paper! Thanks for the link. I'll keep that in mind when I set out to learn XML.


^ Scroll Up | Homepage >

Leave a comment [top of page]

    Please consider creating a Casual Gameplay account if you're a regular visitor here, as it will allow us to create an even better experience for you. Sign-up here!
  • You may use limited HTML tags for style:
    (a href, b, br/, strong, em, ul, ol, li, code, spoiler)
    HTML tags begin with a less-than sign: < and end with a greater-than sign: >. Always. No exceptions.
  • To post spoilers, please use spoiler tags: <spoiler> example </spoiler>
    If you need help understanding spoiler tags, read the spoiler help.
  • Please Preview your comment before posting, especially when using spoilers!
  • No link dropping, no domains as names; do not spam, and do not advertise! (rel="nofollow" in use)
Aquatic Rescue> Dora Also available on mobile devices, OZDY takes you under da sea for an adorable physics puzzle game where you need to reunite baby sea creatures with their parents, though with moving platforms, wrecking balls, switches, buttons that make you shrink or grow and more, it's trickier than you think!  ...
1 Comment
Monkey GO Happy Turkeys> Dora It's Thanksgiving day! But how can you celebrate without a feast! Help the monkeys look all over town in this point-and-click puzzle game from Pencil Kids to find everything they need, including a whole lot of apples, and the bird of honor!  ...
Hoverboard> Dora Webcomic xkcd has been around for over a decade, and to celebrate the release of his new book, creator Randall Munroe has created a very simple piece of platforming interactive art. But venture beyond the small playing field, and you'll find a much bigger world than you thought that's full of surprises.  ...
Rock 'n' Roll Escape> Dora Pine Studio serves up a short but rock-worthy escape in your browser or free on iOS and Android as you try to find your way out of a cozy, abandoned little concert venue. But with a soundtrack this catchy, will you be able to resist air-guitaring long enough to escape?  ...

Recent Comments


Display 5 more comments
Limit to the last 5 comments

Casual game of the week

Mystery Case Files: Ravenhearst Unlocked

Your Favorite Games edit

Save links to your favorite games here. Use the Favorites editor.

Monthly Archives

Legal notice

All games mentioned or hosted and images appearing on JayIsGames are Copyright their respective owner(s).

All other content is Copyright ©2003-2015 JayIsGames.com. All Rights Reserved.

Visit our great partner: maxcdn!