Skip to main content
gamedev.net
🔒 Locked

XML standards

Started by Boder May 24, 2006 at 1:54 PM 3 replies 1.1k views
Original Post
Boder
Boder
I was thinking of drafting an XML format, but before getting started I wanted to know if there are any standard conventions. Most google hits turned up overly verbose results. Like naming convention, uppercase or lowercase, camel case or underscores. Also, what do you think about including position attributes as one attribute, separating elements by commas or colons.
pos3D="33:400:-20" ..... pos2D="14:23"
ronnybrendel
ronnybrendel
i recommend this book

http://www.oreilly.com/catalog/learnxml/
Enselic
Enselic
Well, XML is pretty verbose.

I thought I'd just throw out a good xml link in case you missed it:
XML Tutorial (www.w3schools.org)

Personally I think using lowercase throughout the xml parts looks the best. That way it is easier to get an overview of what is xml text and what is content text so to speak, since lowercase text has a different "look" than mixed case text.
JohnBolton
JohnBolton
I think a standard XML coding style might be useful.
Quote:
Original post by Boder
pos3D="33:400:-20" ..... pos2D="14:23"

This is not a good idea because it requires the application to do parsing (which could easily done by the XML parser instead) and there is no way for the XML parser to check it's validity (so something that the parser says is valid could, in fact, be invalid).

Compare that to
    <pos3D x="33" y="400" z="-20">    <pos2D x="14" y="23"> 
In this case, the parser (with an appropriate schema) can can check that the elements have the proper attributes and that the attribute values are the correct type.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
Boder
Boder
I think I'm going to go Lumixed sytle. All elements begin with a capital and all attributes are lowercased with no underscore separators.

Thanks for the links. And thanks Mr. Bolton for that explanation.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.