• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why all configuration files ae in xml format(ex:web.xml,struts.xml)

 
RabiDas Sharma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks
I dunno why all the configuration files for ex: web.xml and struts.xml
in any web application are xml files.
please tell me

thanks in advance
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not only config files, but XML is used to represent any type of data.
It's easy to define your own tags to hold data.

You can also define schema that describes how to create that XML document.

XML is the most used data format for exchange of information.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's actually a trend away from XML for config files, mostly towards annotations. XML was meant to be human readable, but it's a bad choice for anything meant to be human writable.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Way way back at the beginning of servlets I worked with a servlet engine that used properties files for configuration.

GAHHH! what an incredible mess it was - weird naming conventions for multiple properties files and for the names of properties and the directory structure....

XML came as a great relief. SO much more flexible and easier to modify than those ghastly properties files. Personally I don't find XML all that hard to write - an XML aware editor helps.

Bill
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Surendra Kumar wrote:XML is the most used data format for exchange of information.

I doubt that that is the case; do you have a source for this? Of course, there are any number of ways to quantify this statement, and for most of those there is no objective way to measure them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!