The Artima Developer Community
Sponsored Link

Java Community News
How Will You Use XML in Years To Come?

21 replies on 2 pages. Most recent reply: Feb 9, 2008 10:19 PM by Jason Walton

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 21 replies on 2 pages [ « | 1 2 ]
Andy Dent

Posts: 165
Nickname: andydent
Registered: Nov, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 1:28 AM
Reply to this message Reply
Advertisement
> > Configuration files that don't give me the ability to
> > annotate or insert my own additional parameters and
> > structures mean I can't subclass and extend an
> > application.
>
> This ability is a result of the configure code which you
> write, and which processes the configuration file

Please read my original more carefully - I'm talking about extending other applications, as frequently happens in the open source world. If I have to rewrite their config parser to add in some data, that is a load more work than just being able to include some nested config data of my own and then retrieve it independently of the rest of their configuration parsing.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 7:42 AM
Reply to this message Reply
> Configuration files that don't give me the ability to
> annotate or insert my own additional parameters and
> structures mean I can't subclass and extend an
> application.

What exactly are you talking about? If you are referring to the format I have specified, the above doesn't apply. The file format is semantically equivalent to a subset of XML, the subset that provides useful configuration format.

> Anything relying on whitespace delimitation - correct
> indents and correct linefeeds causes difficulties going
> cross-platform and often causes errors when copied and
> pasted from web pages or emails.

One difference between python and what I have done is that I restrict indentation to exactly 4 spaces. Other whitespace not allowed for specifying levels.

The other thing I don't get about this argument is how all the Python developers in the world are able to get anything done given that it's such a huge problem.

The format I have come up with is just one possible format. The real point is that the API used to retrieve the configuration (and potentially save changes to it) is input agnostic. The data could come from XML, JSON, YAML (I think), flat configuration files in hierarchical directories.

> XML textual representation gives me robust trees.

Have you ever tried doing a compare of two xml files with a standard diff tool? I've spent many hours manually merging XML because those robust trees mean tools can make all kinds of meaningless changes that drive diffs batty.

Elizabeth Wiethoff

Posts: 89
Nickname: ewiethoff
Registered: Mar, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 10:36 AM
Reply to this message Reply
James Watson wrote: "Have you ever tried doing a compare of two xml files with a standard diff tool? I've spent many hours manually merging XML because those robust trees mean tools can make all kinds of meaningless changes that drive diffs batty."

FWIW, I ran across this a few days ago: "Matching, diffing and merging XML" (http://useless-factor.blogspot.com/2008/01/matching-diffing-and-merging-xml.html) plus some reddit comments (http://reddit.com/r/programming/info/66rc2/comments/).

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 11:02 AM
Reply to this message Reply
> James Watson wrote: "Have you ever tried doing a compare
> of two xml files with a standard diff tool? I've spent
> many hours manually merging XML because those robust trees
> mean tools can make all kinds of meaningless changes that
> drive diffs batty."
>
> FWIW, I ran across this a few days ago: "Matching, diffing
> and merging XML"
> (http://useless-factor.blogspot.com/2008/01/matching-diffin
> g-and-merging-xml.html) plus some reddit comments
> (http://reddit.com/r/programming/info/66rc2/comments/).

Yes, I understand it's a solved problem but not all source control systems handle xml diffs properly and the one I had so many problems with would only do XML-diff if the file extension was .xml which of course wasn't the case (and we couldn't change that.)

The point I am making is not that XML is bad, but it's use has it's own issues. If we are going to talk about theoretical issues with one approach to specifying data, we surely can discuss real issues with the proposed solution.

Shivkumar CM

Posts: 4
Nickname: coderboy
Registered: Dec, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 1:42 PM
Reply to this message Reply
I believed that XML was a strong option when one needs to spin small languages for domain specific scripting. However, I found XML very hard to read if it represented some kind of code. Another problem with other applications was that XML tends to bloat the size of the files leading to wastage of bandwidth and processing. I fancy an XML tree to be a map of maps. An XML node is actually a map with keys and values. The values could either be leaf nodes, i.e. just string literals (similar to attributes) or another map (similar to child nodes). Example-

form {
label = "Login Form"

text-box {
label = "Login"
maps-to = "user.login"
}

text-box {
label = "Password"
maps-to = "user.password"
type = "password"
}

button {
label = "Go"
handler = "logonForm.login"
}
}

This concept is very similar to how JavaScript objects behave. Every object is like a map with its properties behaving like name-value pairs.

Dirk Detering

Posts: 16
Nickname: det
Registered: Jul, 2005

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 5:37 PM
Reply to this message Reply
@Shivkumar CM:

Have you ever seen how Groovy's Markup Builder represent a tree?

You should have a look.

Jason Walton

Posts: 2
Nickname: jwalton
Registered: Oct, 2006

Re: How Will You Use XML in Years To Come? Posted: Feb 9, 2008 10:19 PM
Reply to this message Reply
For (A) - binary files, the best fit I have seen was the old Interchange File Format of the Amiga; a structured, extensible binary format that was easy to add things to, easy to read/write, and easy to parse (including giving human-readable variants). For most structured data, this was easier to deal with than XML - both for man and machine.

ASN.1 is a decent alternative for structured binary data, too. ASN.1 essentially lets you specify an extensible schema for your data, and then data can be represented in a number of different binary encodings (DER and BER being the most common). The biggest problem with ASN.1 is a lack of good tools for using it.

Flat View: This topic has 21 replies on 2 pages [ « | 1  2 ]
Topic: Grails 1.0 Released Previous Topic   Next Topic Topic: Dynamic Languages on the JVM and the DLR

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use