Channels ▼

Bil Lewis

Dr. Dobb's Bloggers

More XML

March 17, 2009

written by Robert Brotherus, March 16, 2009 
So here's another attempt at a more condensed xml-version of the battle-data: 

<Battle width="500" height="500" >
  <Side General="Abrams">

  <Tank Type="Sherman" Count="6" Tactics="Tactics1"> 



I assume this is what you were looking for?

I agree, it's rather nicer than that expanded format I used. So how does it compare to the configuration file I used? 

Dimensions: 500, 500
Map: /home/bil/maps/

# One King Tiger against 6 Shermans is about even.
BattalionCommander: Abrams
Tank: Sherman Tactics1 6
Tank: Grant Tactics2 10

BattalionComander: Rommel
Tank: PKW_4 Tactics1 5
Tank: King_Tiger Tactics6 1

I'm not all that impressed by the XML, though it's better than it was. What do you think? Which would you rather edit?

The second question was about XML as a possible serialization format. To this Stephen informs us:

Very good reasons for XML
written by Stephen Constable, March 17, 2009
1. Describes type as well as data so can be used to save and restore complex data structures. 
2. Structured form means trees of classes can be naturally streamed out and in. 
3. Modicum of backwards compatibility over binary. 
4. Automated validation against schema. 
5. XSLT can transform it. 
6. XPath can access it. 
7. XQuery can search it. 
8. Namespaces. 
9. Tools for rendering into pretty formats. 
10. Annoys luddites. 

and more but I can't be arsed. 


So... what do I want these things for? Perhaps I'm missing something. 

In other words, I'm concerned about serializing and de-serializing objects. Right now I get all of that for free with RMI. It sounds like you're telling me I should have to do a lot of complicated work instead. Using RMI, I *never* look at the serialization format. I don't want to. You'll telling me that I should? Do I get anything at all for all that extra effort?

Or is there something else that you guys are aiming at that I'm missing? 

Is there something other than serialization that we're talking about?




* RMI is mainly a remote object technology, but it needs to serialize objects, and that serialization occurs for me with zero work on my part. I like that.

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.