Slashdot Mirror


Expanding the use of XML in Linux?

elemur asks: "I was wondering if there are any projects to expand the use of XML in Linux? There are alot of areas where XML could be more easily and consistently used than continuing making more and stranger configuration files. Many configs could probably fall under a generalized standard application config DTD, and applications that needed something more targeted could supply their own. Some sort of DTD repository could be setup on the machine to handle this. Then, apps just need to use libxml (or whatever it would be called) to handle the reading and parsing. It would seem to make things much more consistent. Has anybody looked into this sort of thing?" It's a good thought. And a standardized configuration file format might be the thing to reduce some of the complexity most folks find in Linux. What do you all think about the capabilities of XML?

Update: 09/29 04:03 by C : Screwtape submitted this tidbit "I just saw this on MozillaZine and I'm quite impressed. Somebody has taken the XML parser from Mozilla, and written software that makes it work like an xterm - but with extra features. For example, you can write a replacement for ls where all the filenames are hyperlinks to the actual files. The site is here. "

216 comments

  1. expat by Anonymous Coward · · Score: 0


    What the expat libs, its about as open source as you can get. ;)


    That is what a few other open source projects use to incorporate XML into their code.

    *Shrug* I would love to learn more about XML and start using it myself.

  2. XML-RPC by Anonymous Coward · · Score: 0

    Not to mention the possibilities of using XML-based procedure calls for remote interfacing. Check out http://www.xml-rpc.com/

    1. Re:XML-RPC by Anonymous Coward · · Score: 0

      Ok Dave.

  3. Re:Good Idea by Anonymous Coward · · Score: 0

    I was just starting on this last night :) I am in the prcess of getting my XML parser on line heheh Benefits: Unicode support Ability to use style sheets to view the data making html system mangament tools easier while at the same time allowing people to go in an hand rework the files. Side notes: nDump the idea of a database to store the files on a machine. AIX and Mach/NeXTSTEP use and idea where you would edit the text files and then reload the database. From a system administration point of view it sucks really bad. It also adds a new level of complexety to a process that dosen't need one. Now where did I leave my language spec. hmmmm Leslie Donaldson

  4. XML - parseable config files by Anonymous Coward · · Score: 0
    Hopefully people will come around to the notion that XML parsers should be a fundamental backbone of any platform.

    Error checking and consistency is contained in the parser, and DOM gives you a grove of nodes to examine further in the laguage of your choice.

  5. I *LOVE* the idea! by Anonymous Coward · · Score: 0

    I am just a 'power user' who is very intersted in Linux et al., so maybe I lack the technical background to fully understand the implications of these. But *do* know a little XML (and learning more ;) and I plan to de some programming myself, and I think this could be The Right Thing(TM). I think this could benefit Linux inmensely, and I hope it is implemented ASAP (are you reading, you coders? Yes, I mean *you* :)

  6. One in Mozzilla? by Anonymous Coward · · Score: 0

    Isn't there an XML parser in the Mozzilla project? And if so, can it be implimented in a Linux ecology seperately?

    1. Re:One in Mozzilla? by ebcdic · · Score: 1

      Yes, it's expat (already mentioned in other comments).

  7. Standards are Good by Anonymous Coward · · Score: 0

    I've seen a little of Linux configuration files, and I think XML would be a great benefit.

    Open standards = Good.

    (As a simple example, Apache configuration files are XML-ish, though not strongly so.)

  8. Parody: Possible Pitfalls of filesystems by Anonymous Coward · · Score: 0

    A filesystem may look nice from the outside and have lots of great features, but when something goes wrong and the settings for your favorite daemon are in a corrupt filesystem what are you going to do?

    A database is not necessarily any worse than a filesystem. (Since a filesystem is actually just a particular kind of database.)

    1. Re:Parody: Possible Pitfalls of filesystems by ~k.lee · · Score: 1

      A filesystem may look nice from the outside and have lots of great features, but when something goes wrong and the settings for your favorite daemon are in a corrupt filesystem what are you going to do?

      Restore from backups of course. This is easy for a filesystem because filesystem interactions are standardized, and hence many tools are available to do periodic filesystem backups of all kinds. Furthermore, since every scripting tool understands the filesystem, it is also easy to write any kind of customized backup scheme of your own.

      A relational database, on the other hand, *especially* if it has capabilities beyond those of a filesystem (transaction processing, record locking, rollback and recovery), tends to require that you use some special application-specific backup utility. This is a big loss for data as simple as configuration files, though for, say, financial records it's worth it.

      ~k.lee

      --
      (remove nospam for email)
  9. Re:Linux the Kernel. by Anonymous Coward · · Score: 0

    I like my separate config files thankyou verry much. No Linux Registry for me...

  10. XML by Anonymous Coward · · Score: 0

    Gnome already hevily uses XML. They have a libXML and GConf is using XML as a backend. Everything you asked for has already come true. Didn't expect that one, did you. :)

    1. Re:XML by Mike+A. · · Score: 1

      Except that, as someone else pointed out, libxml is GPL, not LGPL. Of course, if you're already an ardent Free Software advocate already, or if you're just using it for your own little project that you don't care if it's released, this isn't a problem. But Richard Stallman hasn't taken over the world yet. :-)

      --

      --
      Do I look like I speak for my employer?
  11. Re:XML.. by Anonymous Coward · · Score: 0
    Uhm... XML IS text based.

    Also, people creating DTDs on their own is the whole point of XML: You create DTDs for whatever task is at hand.

    Of course it would be an advantage if configuration files all used the same DTD, but it's not needed to start using XML.

    Another great feature of XML is that it's so easy to convert between different XML formats.

  12. Re:XML already in use by Anonymous Coward · · Score: 0

    AbiWord actually uses XML as it's native format for storing documents.

  13. .xinitrc? by Anonymous Coward · · Score: 0

    .xinitrc wouldn't make much sense in XML... it's one of those things that are really a shell script, like .login or .profile... One more difficulty in doing this.. deciding exactly what is or is not a config file :)

    1. Re:.xinitrc? by ocie · · Score: 1

      .xinitrc wouldn't make much sense in XML... it's one of those things that are really a shell script, like .login or .profile... One more difficulty in doing this.. deciding exactly what is or is not a config file :)

      you could always do something like:

      #!/usr/bin/xml2sh
      .
      .
      .
      XML code
      .
      .
      .

      and have this xml2sh program convert the user's XML version of .login, .xinitrc, or whatever to a shell script to perform the indicated actions. This could help get a lot of applications 'XML ready' without having to rewrite them all at once. As I understand it, the whole point of this is to have a common config file format that is easily parsed and edited by machines, so you could put together the intended XML configuration for a particular application by using xml2sh (or whatever we call it) to do a slower prototype version before committing to use an XML parser in the application itself.

      --
      JET Program: see Japan, meet intere
  14. Ooooo.. just like the Windoze registry by Anonymous Coward · · Score: 0

    A common problem w/ windoze registry is that ill-behaved registry modifiers blow away other apps configuration.

    Seperate is better. Text based is better.

    I hope Linux never tries this horible idea...

    If we're really stupid, we could also get rid of .so versioning, so every app could take it's chances with the last .so installed, just like windoze dll's.

    Furthermore, we could allow .so's to have their own private data area, so that any errant app can bring all the other apps down.

    How about putting all files in "c:/windows", There's another bad idea we haven't adopted yet.

    I wanna be like Bill!

    1. Re:Ooooo.. just like the Windoze registry by Mike+A. · · Score: 1

      Um, but XML is still separate AND text-based. The point is that every app that needs a config file doesn't need to roll its own parser, they can go find someone else's XML parser whose license is consistent with what they want to do, and use that.

      --

      --
      Do I look like I speak for my employer?
    2. Re:Ooooo.. just like the Windoze registry by september · · Score: 1

      but isn't XML represented as text???

  15. XML sucks by Anonymous Coward · · Score: 0

    XML sucks, yet another langage, requires yet another parser fatwear

    move on, change the channel

    1. Re:XML sucks by Anonymous Coward · · Score: 0

      ..Only XML can be parsed reliably and simply. Try parsing HTML for data, unless you are looking for any content within an tag or something.

  16. Why not S-exp/Guile configs? by Anonymous Coward · · Score: 0
    Wasn't GNU trying to move towards using Guile as a configuration language?

    That seems a better choice. XML has nothing that S-exps don't have, but S-exps are much easier to parse.

  17. Re:Linux the Kernel. by Anonymous Coward · · Score: 0

    It seems the poster wants XML introduced into all applications - not really the Kernel.

    No offense, but whether you like it or not, people are going to be using the word "Linux" to include the kernel, required binaries and supplemental programs -- in short, the whole ball of wax. If somebody wants a change in the kernel, they're going to say "Linux kernel."

  18. Re:Possible Pitfalls of XML by Anonymous Coward · · Score: 0

    I think we are missing the point here. What is great about Linux is that there are choices. The one that works best for people is the standard. nobody descides. We ALL do. It's evolution. We're not try into beat Microso~1. We are try to create a great OS. Worry about that first and MS won't know what hit them.

  19. Re:ASCII, not XML by Anonymous Coward · · Score: 0

    the use of simple separate config files written in xml is that they can be moved, edited, built using simple sh, grep, awk, cat, vi, etc. commands OR using automated or GUI based tools.

    XML files are text files, they're just written in a way that helps stupid computers tell what they're about as easily as smart people can.

    I doubt seriously that anyone who has the ability to edit config files by hand is going to notice a readability difference between

    Username = joeblow

    and the xml representation of the above, which would be "Username" wrapped in angle brackets followed by "joeblow" followed by open-angle-slash-closed-angle.

    I'd type it literally, but for some reason /. filters out the tags even in "Plain Old Text" mode.

  20. Re:Who needs grammars or parser generation? by Anonymous Coward · · Score: 0

    Aaargh my angle bracket expression got garbled by the preview even though I used HTML &-entities. The relevant parts were:

    Instead of using XML <foo> and XSL or CSS you can as well use <P.foo> or <TD.foo> and CSS.

    And as a programmer I don't care if my data is

    name,value or
    name=value or
    <name>value</name>


  21. XML? Hooray! by Anonymous Coward · · Score: 0

    I like XML's syntax, but have a very small idea
    of how it really works. I figured that I could
    remedy this by making my next OPEN SOURCE PROJEKT
    use XML as a config file format.

    Clearly, by the monumental support here, others
    like the idea as well. This is definately
    something worth learning since it's popping
    up EVERYWHERE.

    Also, to note: There's no real work involved
    in "converting Linux to XML". If all open source
    developers "in the know" use XML from now on,
    you can bet that in 2 years, everything will be
    using XML. (I'm sure, say, the Apache developers
    are already moving in this direction).

    What I want to avoid though is writing a custom
    XML parser, especially if in 2 years, every
    Linux distribution is going to have one. Does
    anyone know which one that is likely to be?

    Should we start arguing now?

    Linux Standard Base anyone?

    --Michael Bacarella

    1. Re:XML? Hooray! by Radagast · · Score: 1

      >Several Linux distributions already include an
      >XML parser that could (should?) become the
      >standard: libxml, written by Daniel Viellard
      >(he also runs the rpmfind system) from the W3C.
      >It is already in use by the GNOME project.

      While libxml is nice for simple parsing, it's not really satisfactory for larger applications making heavy use of XML, simply because it doesn't validate. Of course, there's always RXP, which does validate, is GPL, written in C, and quite fast. We chose to use that for a rather large document system we're finishing these days (soon to be released under the GPL, tell me if you're interested).

      --
      --Joakim Ziegler
    2. Re:XML? Hooray! by isenguard · · Score: 2

      > What I want to avoid though is writing a custom
      > XML parser, especially if in 2 years, every
      > Linux distribution is going to have one. Does
      > anyone know which one that is likely to be?

      Several Linux distributions already include an XML parser that could (should?) become the standard: libxml, written by Daniel Viellard (he also runs the rpmfind system) from the W3C. It is already in use by the GNOME project.

      See http://rufus.w3.org/veillard/XML/xml.html

  22. Re: *Binary* registry bad. Text registry good. by Anonymous Coward · · Score: 0

    There is nothing wrong with the concept of a "registry." In fact, /etc can be viewed as a very poorly designed registry, and Debian (and others) have no problem maintaining installed package registries.

    Where Microsoft's registry did a major face plant into the cow patties was

    1) it uses a *binary* registry, so manual modification of the registry is difficult if not impossible,

    2) it is accessed by code with the same high quality that we see in all other MS software. That means you'll need to manually edit the register on a regular basis, but #1 means that's difficult.

    I would have no problem with an XML registry, and in fact I've done some preliminary work on some programs that slurp in much of an existing /etc directory and emit xml and vice versa. This approach also makes it easy to migrate to XML tools, since the XML-aware applications will read the XML files and the rest will read config files generated from the same files.

    I would also not be too worried if my registry was stored in a RDBMS with a solid track record. Postgres is a totally free one, MySQL is mostly free, and Oracle would work on those sites which have to deal with thousands of users.

    But a binary-only registry with home brew access software?! I wouldn't trust software *I* wrote for that, much less MS software.

    (coyote-san on soon)

  23. Re:Upsides, Downsides... by Anonymous Coward · · Score: 0

    >maybe it's a religious issue.

    Don't sell your argument short. The standard computer "Religious Issue" means there is no compelling technical reason to choose one over the other. However, there are strong reasons to favor ASCII over binary config files. The biggest reason is that a binary config file needs Yet Another Application to view/change. ASCII config files only require an editor. There just easier to use -- try grep'ing a group of binary config files to find some chunk of info.

    Anonymous Kevin

  24. Re:Possible Pitfalls of XML by Anonymous Coward · · Score: 0

    Yeah, that's why Postgre is so much more stable than MS SQL-Server, right? Ha!

  25. Re:Problem with libxml by Anonymous Coward · · Score: 0

    Libxml is released under both W3C Public licence
    and LGPL, you can freely reuse it in commercial
    closed source projects.

    I'm not an A.C.

    Daniel

    Daniel.Veillard@w3.org (libxml main author)

  26. I Prefer ASCII by Anonymous Coward · · Score: 0

    Posted by Project'Resin (I can't register, keep getting rejected). NO - It violates the keep it simple principle. It is poor design to require an extraneous package to be present and already operating in order to bring up the main program. This is true for booting the operating system, starting an IDE, or launching an application like a browser. NO - When config files are wrong they must be fixable with the simplest tools. ASCII config files only require a PLAIN text editor, which can be run from a floppy rescue disk. I gave up on Red Hat's GUI program for just that reason, I could not get X11 to come up, but their config tools required it. I am sticking with Slackware and their simple .rc files, kept in a subdirectory of /etc. NO - Anything that slows up booting or launching tasks will not be an "improvement". Anything that takes Linux towards the integrated-bloated software concept pushed by some of the software giants will not have my support. I want config files to be separate and independent so when I mess up one of them the whole system isn't affected. YES - To something that will help INTERPRET the current config file formats. Some kind of common tool that knows the legal values that can be included would be of great help. A common point (like /etc) to look for config files (or links to config files) would also help. But the config files themselves should stay plain ordinary ASCII. YES - If you can improve the syntax of the config files so they use the same idioms. But this does not require any tool, system, or meta-language to get between the config file, the config file maintainer, and the config file reader. YES - A library module that reads config files, so that every application does not have to invent their own, would be a welcome addition. But this does not require XML, and I do not see what XML would bring to the concept. File reading and tokenizing are the main needs from a library tool, no interpretation which is entirely dependent on the applications needs. (Okay, someone is going to have to tell me how to get a line break ...)

    1. Re:I Prefer ASCII by EthanW · · Score: 1
      XML files are plain ascii files. They can be edited just fine by vi, and as long as their definition is not insane they are plenty easy to read.


      XML is not inherently easier or harder to read than any other configuration file format.


      BTW, you can get a line break by adding a <p>

  27. Re:XML and configuration systems... by Anonymous Coward · · Score: 0

    Actually XML is a bit more general than S-exps in that it allows you to pass parameters, and specify that these parameters are optional, fixed, or have default values. Of course these can be simulated in LISP, but the ways XML handles them is cleaner.

    There's no semantic difference between <foo bar="baz">quux</foo> and (foo (:bar "baz") "quux"). The differences are

    • that the Lisp reader parses the second with literally zero work, whereas I have to write cruft with SAX or the XML DOM to parse the first,
    • and once the data structure is there, I have all of the most powerful programming language ever invented to munge the s-exp, and I have the lowest common denominator DOM interface to munge the DOM tree.

    I'm worried that my tone is too flaming, but it's hard to convey how much easier the s-exps were to use without sounding like a language bigot. :( (I bet Perl hackers feel the same way trying to convince people that Perl is a great improvement over shell scripts + awk.)

    Also XML has something resembling a type system in its DTDs, which seems somehwat alien to the LISP mindset...

    Not in my experience -- it was easier to check correctness in the Lisp version. A DTD isn't a real type system for XML documents, it's just a constraint on the shape of the document's tree-structure.

    I literally took the cheesiest possible way to write my "Lisp Markup Language" tree-walker (recursive invocations of DESTRUCTURING-BIND, basically) and it automatically gave me the equivalent of validity-checking plus I was able to add the type-checking on the element content.

    I got a stronger test of correctness than validity for free -- you'd need to use an XML schema to get as strong checking as I did, and you'd be doing a lot more work than my evening hack.

    Fundamentally, the key idea behind XML is that it's better to systematically modify data structures than to randomly hack strings, and that a good way to do this is to use a string encoding format that makes it easy to convert from string->data and data->string. This is a good idea, and XML is a great improvement if you are used to the prevalent way of doing things.

    In Lisp, tree structures are programs, so you use this whole powerful language focused around manipulating these interesting data structures. XML has very weak transformability in comparison. And since the point is to do things with the data beyond just admiring how nicely the tags (or parens) match up, this makes Lisp easier to manipulate than XML.

    This obviously won't take the world by storm, but I do feel obligated to point it out in case there are people for whom how powerful a solution is is more important than how widely a solution is used is. (You should look at Curl for another much more extensive example of how powerful the Lisp-like approach to documents is.)

  28. Re:Linux the Kernel. by Anonymous Coward · · Score: 0

    He wasn't suggesting a registry, he was talking about a unified config framework like the MMC. So you have one config app that you can plug in modules for configuring all your apps, and even the kernel. Your config files would still be wherever they are, just in a standard format. There would be a unified config app, but you could still edit the files yourself. Well, that's what I thought he meant.

  29. Re:Well, darn by Anonymous Coward · · Score: 0

    You've still got your project.

    Organize a group to define the config file standards, not code the XML library.

    Go for it! ;)

  30. Documentation by Anonymous Coward · · Score: 0

    I think that the first area that should be explorer are the documents (HOWTOs, FAQs, man pages). The key to using XML is to separate the information from the presentation. By including meta information, we make these things easier to organize, easier to search on, and easier to present. If someone were to define a DTD for man pages, I can then create my own applications for presenting the man pages. Maybe I want HTML; I can use XSL or CSS to format the XML man pages. Maybe I want plain text, so I build a converter. Or I can build a search program which reads the appropriate tags. There's alot of possibilites. And from what I can tell, man pages are in a funky format. This would mean XML man pages would be easier to write. This goes without saying for the HOWTO's and other documents that we rely on to use Linux (and other Unix systems) more effectively.

  31. Re:great by Anonymous Coward · · Score: 0

    And the point of making us do all of that extra typing is what?

  32. Tree structured db's? No thanks! by Anonymous Coward · · Score: 0

    Most tree structured databases are simply badly thought out and and usually badly implemented versions of the file system.

    This is likely to be one example of that.

    There are very few applications that could profitably use a tree structured database instead of a file/directory tree.

    Compared to the native file system, databases are high overhead, non-portable, have non-standard file formats, usually have bad error recovery, often cannot be worked around if there's a corruption, have slow access because it's not built into the kernel, have high memory overhead, often have bizarre locking semantics, are susceptible to revision control problems as each latest and greatest database engine comes out, often have large files for even small amounts of data and use non-standard compression mechanisms.

    Locking in the file system is well understood, is simple and it works. Granularity is controlled by varying the size of the files versus the size of the directory structure. If file/directory size is an issue then they can be compressed with tar/gzip/bzip or by using a compressing file system. Data validity in such a directory tree is controlled in an identical manner to a database - by the programmatic access to it.

    Don't reinvent the wheel and create a proliferation of half-baked semi-solutions. Use the fast, easy and effective tools you already have.

    This advice comes from bitter experience with a number of databases that purported to be the be-all end-all of data organization.

  33. Would it be possible... by Anonymous Coward · · Score: 0

    To keep the config files exactly the same as they are now and write an XML definition for each config file then write a tool to use the XML definitions to edit the actual config file through a browser?

    I am loath to change the current config file formats for one major reason: They currently work and work well. I was raised with the notion that if it ain't broke don't fix it.

    My 2 cents worth...

  34. XML and Linux by Anonymous Coward · · Score: 0

    There is no user interface. There is only Xul.

  35. Re:Linux the Kernel. by Anonymous Coward · · Score: 0

    Think of parser generators in XML, GUI programming etc.

  36. GUILE as configuration language by Anonymous Coward · · Score: 0

    If you forget the hype, XML really doesn't bring you anything plain old LISP (or GUILE) wouldn't already have. Both are just ways of serializing tree structured data, but LISP has a simpler structure with parenthesis enclosing each level instead of cumbersome pairs.

    Choosing XML would be downright stupid when you think that almost every GNU/Linux user knows how to edit his .emacs file and hardly anyone has any experience with XML. There is also a lot of support for writing LISP code in Emacs (automatic display of matching parenthesis etc.) and very rudimentary XML support.

  37. Re:great by Anonymous Coward · · Score: 0
    XML is a great format for representing heirarchical (sp?) data. How is this helpful for config giles
    Easy. A complicated app. needs many config. parameters. For ease of use they ought to be partitioned to some user-friendly sections.

    I know of an application which has about 300 user-configurable parameters!

  38. XML not good for Linux by Anonymous Coward · · Score: 0

    XML lacks some very specific features, like:

    - ability to add something to the end of the file. XML requires a starttag and a corresponding end-tag. Additions to an XML file must be inserted in the middle.... Try to change /etc/passwd into XML and you understand, why this is a bad idea.
    - XML makes bigger files.
    - XML makes more unreadable files compared to /etc/smb.conf.

    Microsoft wants XML, because:

    - They can implement proprietary tags that make it necessary to use Microsoft software.
    - FUD: People think they need to learn Microsoft XML and therefore they haven't time to look at Linux.
    - Using XML in web-pages prevents people from using other browsers like Netscape, KFM etc., until they get it implemented, too.

    Don't support Microsoft - only use XML for what it's good for.

    Lars Dybdahl.
    lbd@dybdahl.dk
    (not a coward, but I forgot my password)

  39. XML by Anonymous Coward · · Score: 0

    I am currently strting an easy to use XML passer and XSL processor in ANSI C. Owen Synge

  40. Re:Here is some info on XML by Anonymous Coward · · Score: 0

    If even half of what you say here were true, XML would indeed be a wonderful thing. But unless I have missed something in my reading on XML, it is not what people are making it out to be. Specifically it does not provide "seamless interchange facilities". In order for it to do this it would have to carry the semantics which attach to the data it describes. In other words it would need to be a programming language. Just because XML gives me a way of defining a data structure, doesn't mean that it is really useful. It only becomes useful when different consumers of XML-described data can agree on the semantics of how to manipulate that data. There is no mechanism in XML to describe this; no introspection; no control flow. I predict a rapid growth in the use of XML, followed by disillusionment as people realise that the "version problem" hasn't gone away. With reference to using XML as the standard for Linux config files, it wouldn't fix anything. The semantics attached to the data would still inhere in the particular programs used to manipulate any given config file. Getting the data in and out of the file in XML is not going to change that. If you want a standard for writing config files, maybe it should be some form of scripting language. Then the interface would be through a commonly-defined class structure which would include methods for GUI or character-based manipulation. I don't care what format you store your data in, until and unless I need to manipulate it with an application other than the one which created it, in which case I need a whole lot more information than just what the data structure looks like.

  41. Re:Why a standard DTD by Anonymous Coward · · Score: 0
    I think you are right. I guess, after all, that this is one of the reasons for advocating the use of XML instead of plain ol' HTML: using and/or making you own markup language, suited to describe structure of YOUR data, and no just some generic one-size-fits-all-suits-none DTD. Myself, I can see that in my field, biology, and how we can move to electronic info handling. I love the Web for science (after all, that was its intended use, remember? :) but

    Cyprinus carpio Linneaus 1758

    just won't do it--I'd rather use something like Cyprinus carpio Linneaus 1758 . Same thing I think with the configuration files. You can parse them with almost any XML browser and make a GUI conifguration tool using the specific DTD and XLS for the application, make changes, and them send the changed config file back to the application--no binary registry, no need to get 10000 pleople to agree on ONE standard good for every project and for all ages to come--or you have to do this AGAIN to update it! :( About editing config files as text--you can do it as well with XML, in fact, *darn*, I JUST DID! :)
  42. Re:Why a standard DTD by Anonymous Coward · · Score: 0

    SORRY, BUT /. FILTER F.. UP THE PREVIOUS ONE :) I think you are right. I guess, after all, that this is one of the reasons for advocating the use of XML instead of plain ol' HTML: using and/or making you own markup language, suited to describe structure of YOUR data, and no just some generic one-size-fits-all-suits-none DTD. Myself, I can see that in my field, biology, and how we can move to electronic info handling. I love the Web for science (after all, that was its intended use, remember? :) but <P>Cyprinus carpio Linneaus 1758</P> just won't do it--I'd rather use something like <TAXON><GENUS>Cyprinus</GENUS> <SPECIFIC_EPITHET>carpio</SPECIFIC_EPITHET > <AUTHOR1>Linneaus</AUTHOR1> <DATE>1758</DATE> </TAXON>. Same thing I think with the configuration files. You can parse them with almost any XML browser and make a GUI conifguration tool using the specific DTD and XLS for the application, make changes, and them send the changed config file back to the application--no binary registry, no need to get 10000 pleople to agree on ONE standard good for every project and for all ages to come--or you have to do this AGAIN to update it! :( About editing config files as text--you can do it as well with XML, in fact, *darn*, I JUST DID! :)

  43. Re:XML helps you see matching pairs by Anonymous Coward · · Score: 0

    > In XML, however, you can see the equivalent
    > of the closing parenthesis with your naked eye,
    >, without a browser designed specifically for LISP.

    You are going to watch at XML documents with a text editor? Without tools? Shiver...
    Good luck...

  44. Re:Linux the Kernel. by Anonymous Coward · · Score: 0

    The only problem with that is the same set of problems that you suffer under Windows today. You can't understand it, you can't manage it, and if it gets corrupted then EVERYTHING is corrupted and you can't recover.

  45. Re:XML helps you see matching pairs by Anonymous Coward · · Score: 0

    > A closing XML tag is always immediately obvious.
    Don't believe it.

    1) Many XML files
    will be poorly formatted, so you
    need a pretty-printer (-> Lisp).

    2) The Structure will be as complicated as
    in HTML files. Have you ever tried to
    see the matching end of a table tag in a non-trivial
    HTML file - good luck.

    Without Editor support for navigation you
    won't see the end of XML forms. You
    could use a Lisp editor such as Emacs
    the same way.

    3) A Lisp programmer does not see the
    parentheses. She reads the code by using
    the clues from the names of the forms
    and from indentation. She also uses
    the editor to take advantage of the
    parentheses (moving, selecting, transposing,
    indenting, commenting, evaluating, ...).

    Actually for a Lisp programmer the Sexp-syntax
    is a ***huge*** productivity boost.
    She can manipulate large amount of code
    with a few keystrokes and mouse clicks.

  46. gnumeric uses xml today by Anonymous Coward · · Score: 1

    Miguel de Icaza and the GNOME team agree with you. They've been using XML to store gnumeric spreadsheets for awhile now. See ya, WaRtHaWg

  47. Re:Same Thought..What about OSS ODBMS? by Anonymous Coward · · Score: 1

    You can buy one, but is there a OSS ODBMS out there?

    One of PostgreSQL's lesser-known features is that it is not just a relational db, but a full object-relational system.

    I think this is a better approach than pure OODBMS's -- I've had bad experiences with them; ad-hoc queries are a pain, and only God can save you if a pointer gets corrupted and your db suddenly forgets how to find half the data you put it.

  48. Disadvantages of XML? by Anonymous Coward · · Score: 1

    A couple of people have cited what they believe to be disadvantages of XML that I don't really agree with.

    1) Something else to learn.

    The DOM XML API (which is what is used in expat) is pretty easy to use. If you stick to simple structures, which most apps would, it would probably be easier to learn the DOM than it would be to roll your own config format.

    2) Extra data overhead.

    This is probably not significant enough to worry about. Most apps should do fine by only reading the config file at startup, and in the era of 20GB disk drives a few more characters isn't going to matter.

    "Username = me" could become me

    3) Speed

    While using XML to describe user interfaces and fabricating the UI everytime a dialog is painted probably does slow things down noticably, simply using xml for the config file probably isn't going to cause any huge speed issues.

    4) DTD Proliferation

    This could be a real problem. However, I'm not sure it would be neccessary to even define DTDs for config files. Well-formedness (all your tags are balanced) should be enough. Of course, this does sacrifice the ability to syntax-check the configuration.

    That being said, I don't think XML will be very valuable everywhere. For example, in sendmail.conf the real work isn't in parsing the config file to extract the rules, but in turning those rules into meaningful behavior. So the work of converting it to using xml probably isn't worth the small payoff. However, for most apps that use the simple "option=value" configuration style XML can provide real value.

  49. Re:XML and Linux: a new distribution by Anonymous Coward · · Score: 1

    Just a little reminder: Niether RPM, nor .deb are proprietary. Detail descriptions of both formats are easily attainable. As would your package format. It's just a matter of people using it. Also, there are the differences in how the dependancy tree is handled. Debian's is much more elaborate. That has little to do with the package format though.

  50. Re:Who needs grammars or parser generation? by Anonymous Coward · · Score: 1

    There exists no mechanism for specifying semantics for a program which intends to use your DTD-defined language as the form of its own configuration files, or whatever purpose. Implementing those semantics is as hard manual works as with any other non-XML syntax.

    There's the denotational semantics, which the Scheme and ML people use in their respective standards to define the semantics of their languages. The only problem is that the widespread use of formal semantics means programmers would have to think hard about the design and behavior of their programs, so that's clearly not feasible. :/

    ...but XSL is the most horrible thing I have ever seen on my career. I won't go to details here.

    Agreed. DSSSL was beautiful; I don't understand why the W3C threw away an elegant solution and replaced it with an ugly one. It's not even worse-is-better, it's just nuts.

  51. The Gnome XML library by Anonymous Coward · · Score: 1

    [I have trouble posting comments, retry]

    This library is used in the gnome project for a number of program including gnumeric, gill, dia, libglade, etc.

    It offers the following:

    • SAX interface
    • DOM tree building an manipulation
    • Validation (but there is still problems sometimes)
    • Released under LGPL and the W3C License
    • nearly complete XPath implementation
    • HTML parser included
    • a minimal HTTP for remote DTD or external parsed entities fetching

    Documentation and code can be found from the libxml home page

    Considering keeping DTD around, I was thinking about that, I need a DTD cache with the URL and System ID association, this would be welcome.

    I'm not an AC !

    Daniel

    Daniel.Veillard@w3.org

  52. It's all in the mind. by Anonymous Coward · · Score: 1

    It all depends on how you look at it.

    a) The Unix way: Stuff everything into a proprietary configuration format. This has the advantage that any text editor can read and write the configuration allowing unlimited configuration options and semantics. So would a GUI text editor renamed to "System Setup" and allowing only to edit configuration files /etc/* and ~/.* be easier to use? Many people would probably say yes. If it doesn't say its a text editor.. is it a text editor?

    b) The GUI way: Give everything a nice "clickable" configuration using checkboxes to represent boolean and text fields to represent text data. Merely representing text semantics as graphics semantics.

    XML is just more complexity being added to an already too complex computer world. IIRC Unix was designed around simplicity. Giving few, simple commands such as cat/grep/etc. and pipes such as stdin/stdout Unix was able to do just about anything.. and still can. Unix was a very simplistic, basic design that was not designed as featureful or powerful. It became powerful by having simple components which did one thing and only one thing.

    IMO, its time for a new operating system and paradigm. Unix has outlived its usefulness and today we need ways to communicate in 2d, 3d, audio, and text. We need ways to simply talk to a program/object across the globe or to talk within the same program or computer.

    I think we need to look at what we really want our computers to do instead of how we want them to do what we want them to do.

    Ok.. enough incoherent ranting.

  53. Central XML registry for READING by Anonymous Coward · · Score: 1
    I think the greatest utility of xml would be for configuration/data files that other applications want to read. A classic case would be the password files but this horse is already out of the barn.

    There has been much argument in this discussion about the utility of a central "registry". Although I agree with the idea that since most problems with the M$ registry come from applications messing up when they are trying to update their sections of the registry. I would think that any configuration information that an application wanted to keep for itself should be in a separate file in whatever file format the developers wanted.

    But I would think that there is a place for an xml registry that would hold information that many programs would like to read. It would hold information like IP number, color depth of the screen, available screen real estate etc. Since the main application file formats are already finely tuned and well established. It seems likely that this information should be maintained by some second program like syslog which other programs could pass information to, perhaps using the xml streaming protocols described in this discussion.

    In this scheme, the syslog-like program would then write the files to an xml file that other applications could read (but not write). This would be somewhat like way BSD uses databases for fast queries while maintaining the primary document as a text document. Only here the xml is used not for speed but generality while the applications use their own private configuration files for safety (which may or may not be in xml). Of course if applications were already using xml for system information, it would make sense for them to also use it for their own configuration files.

  54. Eschew Buzzword Based Planning by Anonymous Coward · · Score: 2

    Linux (and to a lesser degree Unix) are great because they are vitually pure meritocracies. Code has traditionally been adopted into the standard tool set because it is useful, not because it is marketable. The day the Linux community starts (more or less) collectively agreeing to and anouncing paths chosen by buzzword, Linux will have the same future as Windows. The right way to do this is to allow some enterprising XML advocate create a distro with XML based configuration files and see if it catches on. A few moth ago, Linux Today posed the question, "Should the kernel be rewritten in Java?" The answer is, of course, "If someone wants to!"

  55. Here is some info on XML by Anonymous Coward · · Score: 2

    Here is some info on XML

    1) Scientific American - XML and the Second-Generation Web
    http://www.sciam.com/1999/0599issue/0599bosak.ht ml


    2) XML Overview
    http://xdev.datachannel.com/directory/xml_101/xm l_overview.html

    XML Overview

    XML is soon to be the lingua franca for open information exchange on the World Wide Web. XML can be used for business-to-business transactions as well as for information delivery directly to a consumer (via a browser or the like). XML is all about information although XML per se is not concerned about how the information is displayed to the human reader.

    What is so important, then, about XML? XML provides a significant advance in how data is described and exchanged by
    Web-based applications using a simple, flexible standards-based format. Hypertext markup language (HTML) enables universal methods for viewing data; XML provides universal methods for working directly with data. XML is a subset of Standard Generalized Markup Language SGML)that is optimized for delivery over the Web. It is defined by the World Wide Web Consortium (W3C), ensuring that structured data will be uniform and independent of applications or vendors. XML interoperability kick-starts a new generation of business and electronic-commerce Web applications.

    The power and beauty of XML is that it maintains the separation of the user interface from structured data, allowing the seamless integration of data from diverse sources. Customer information, purchase orders, research results, bill payments, medical records, catalog data and other information can be converted to XML on the middle tier of a three-tier enterprise IT architecture, allowing data to be exchanged online as easily as HTML pages display data today.

    Data encoded in XML can then be delivered over the Web to the desktop. No retrofitting is necessary for legacy information stored in mainframe databases or documents, and because HTTP is used to deliver XML over the wire, no changes are required for this function.

    XML is valuable to the Internet as well as large corporate Intranet environments because it provides interoperability using a flexible, open, standards-based format, with new ways of accessing legacy databases and delivering data to Web clients. Applications can be built more quickly, are easier to maintain, and can easily provide multiple views on the structured data.

    As well, for any company adopting XML to extend their offerings, XML:

    Is open, easy, and flexible to systems and application developers.
    Can turn a Web-based enterprise into the ultimate database of databases. Is platform and systems independent.
    It operates in a structured data environment with seamless interchange capabilities.
    Sits on top of HTTP or IP and provides the protocol and language for exchanging data or information. Improves efficiency at the browser presentation tier and is an effective content storage mechanism.
    Is a data integration technology that allows distributed systems to exchange and manipulate only required information.
    Helps manage large repositories of content that are both addressable and structured.
    Provides a uniform method for describing and exchanging structured information.
    Allows every piece of information to be accessed in a Web XML-based infrastructure that has its own URL.

  56. The Gnome XML library by Anonymous Coward · · Score: 2

    This library is used in the gnome project for a number of program including gnumeric, gill, dia, libglade, etc.

    It offers the following:

    • SAX interface
    • DOM tree building an manipulation
    • Validation (but there is still problems sometimes)
    • Released under LGPL and the W3C License
    • nearly complete XPath implementation
    • HTML parser included
    • a minimal HTTP for remote DTD or external parsed entities fetching

    Documentation and code can be found from the libxml home page

    Considering keeping DTD around, I was thinking about that, I need a DTD cache with the URL and System ID association, this would be welcome.

    I'm not an AC !

    Daniel

    Daniel.Veillard@w3.org

  57. Who needs grammars or parser generation? by Anonymous Coward · · Score: 3

    XML means an infinite set of yet undefined HTML like languages with no semantics whatsoever. With a proper DTD you have one language from this XML set of languages. You still have no semanctics, except what you write down to the DTD as human language comments.

    With an a style sheet, either XSL or CSS, you can define a semantic transformation where a syntactic element of any XML family language, like a tag , is given a semantically meaningful visual presentation. Instead of using XML you could as well use plain HTML 4.0 with CSSS and tags like or to get the same result. XML gives you no benefit at this level here.

    There exists no mechanism for specifying semantics for a program which intends to use your DTD-defined language as the form of its own configuration files, or whatever purpose. Implementing those semantics as as hard manual works as with any other non-XML syntax.

    XML is a hoax. It is actually nothing but a free licence to invent an infinite number of your own "" and just pray that somebody will agree with you on their meaning.

    Of course the world can negotiate standard XML DTDs with standard semantics, and standard software to interpret them. But agreeing on them and getting the semantics implemented is the exactly same problem as would be regardless of their syntactic family ties. The computing world is full of different formal languages, and the their syntactic variance is not a big deal. Finding a good syntax for an application domain is important, and implementing the semantics is the challenge. Just _parsing_ simple specialiced syntaxes for configuration files or application specific data is trivial with modern tools anyway.

    I could not care less, if the data I have to parse is comma separated fields, name=value pairs or XML compliant value.

    XML is vapor, a hoax, but XSL is the most horrible thing I have ever seen on my career. I won't go to details here.

    Anssi Porttikivi
    app@iki.fi
    currently mostly a html/http/Tcl/Oval/database programmer

  58. Re:XML and configuration systems... by Anonymous Coward · · Score: 5

    While I agree this can definitely be another good way to use XML; I'm not sure everyone will be willing to abandon the ASCII config file formats they have been using for a very long time, and move to an XML-based configuration registry. But something like this has to be done sooner or later...

    Why? Using XML for configuration files doesn't actually buy you anything. All XML is is a way of concisely describing the format of a file -- but the data (and more importantly the data's semantics) in each configuration file will vary between programs just as much as they do now.

    If you proposed that all configuration files be written as Lisp s-expressions, people would look at you funny because they could easily see that that doesn't magically win -- but mumbling the phrase "XML" seems to escape those filters, even though it's just s-exps with typed parentheses.

    [I'm not kidding about the s-exp thing, either. I started to write a little system using XML and XSL to transform some of my docs into HTML, flat text, and LaTeX forms. But when I realized (thanks to Erik Naggum) that the XML document was just a way of serializing a tree structure I changed tacks. Instead, I stored my docs as Lisp s-exps and then was able to use Common Lisp instead of XSL to write the tree-walker and was done in a quarter of the time the other way would have taken.]

    In any event, the thought that might bring real benefit is the idea that you can build a hierarchical configuration structure where apps can acquire config data from the containing configuration classes. (It shouldn't be a registry tree, though, because an application might rightfully belong to several disjoint classes -- you'd want a registration directed acyclic graph.) Defining XML DTDs would be a convenient (but not essential) way of creating a lingua franca.

    In essence, configuration classes would correspond to OO classes, and the configuration acquisition tree would be an inheritance graph. This could be huge win if the graph were well-designed, because each piece of config data would be kept in one place, and program configurations would automatically adjust when that unique datum was changed. However, if the tree were poorly-designed then you would lose big in the same ways that bad OO designs suck hard -- configurations would be very brittle with lots of interapplication dependencies and needed information would be scattered all over the place.

    My personal belief is that the registry approach would tend towards the "huge lose" case -- incrementally designing a good OO architecture requires aggressive refactoring, and refactoring configuration information among dozens of software projects that aren't even necessarily aware of each other would be an interesting problem in change management.

    So I see having to manually adjust individual configuration files is the price we pay for letting each project develop independently of the others.

  59. Re:Pluggable Configuration Modules? by servo8 · · Score: 1

    GNOME (specifically, Havoc Pennington) is developing something similar to what you described, in which a single configuration API can output to different formats -- the default is XML, but in theory you could have such systems as LDAP used. In case you're interested, a prototype is available in cvs module gconf.

  60. great by Suydam · · Score: 2

    That's a great idea. There are several places XML is being used rather efficiently already. I know that that the Gnumeric spreadsheet program already stores its files in the XML format. This, to me, is one of the great things about XML....

    --


    Werd.
    1. Re:great by mangino · · Score: 1

      I read through all of the comments on the page and I keep coming up with a single question:
      Why XML?
      I don't see the added value in using XML for a configuration file format. XML is a great format for representing heirarchical (sp?) data. How is this helpful for config giles? Config files are normally sectioned key value pairs. In my experience, the easiest config file format is the old Windows INI file format, which looks like [section] key=value key2=value2 Not only is this format easy to parse, easy to read and flexible, it also has been used widely and many parsers for the format have been written.
      It appears to me that most people who want to use XML for configuration files don't really understand XML, or don't really want XML. All they want is a localized configuration file with a common syntax. If you can provide a good reason for using XML in configuration files, please email me and explain.
      Mike, who thinks GLADE is a really cool use for XML.

      --
      Mike Mangino
      mmangino@acm.org
    2. Re:great by jilles · · Score: 2

      "This doesn't make any sense. The XML would have to be stored somewhere. My guess is in /etc/something. As for user-specific settings, where else would they go but some .something/ directory in the user's home?"

      true, didn't think of that. You might want to consider storing it somewhere else though because the last thing you'd want is joe average launching turbo vi to mess up his config file.

      "Such "generic software" already exists for flat ASCII text files. It is called emacs, vi, perl, sed, awk, grep, diff . . . the list goes on and on"

      BS. It's not the same, if you don't see that you have a problem. I'm not going to waste my time trying to explain you the difference between a text editor and configuration tool.

      "This isn't that shocking a suggestion, since it's been done. Those who have programmed ColdFusion Server's CFML language, to take one example, already know that XML-based programming languages tend to have heavy, verbose, and annoying syntax because you have to enclose everything in angle brackets."

      Now that's interesting's I guess those guys were trying their generic vi/emacs editors on XML. Jesus! The idea of XML is definitely not that you open vi and start hacking away. Rather you build a tool that does it for you. If you really want to program good old c, just build a program that parses the file and converts it to C. This is also a great way to convert old code.
      Imagine having the linux source tree available as a giant XML tree. Sure it would be big but you can always gzip it.

      "One feature of markup languages like XML and HTML is that anything not enclosed in angle brackets is a string literal. This is good when you want to mark up content, but annoying for general-purpose programming. How much of the average program consists of string literals?"

      I wasn't talking about enclosing the original source but rather about replacing it. I.e.

      public void aMethod(int param)
      {
      a lot of other stuff
      }

      would become something like




      a lot of other stuff



      Now the fun part would be inserting tags like bla bla
      smart ass
      etc.

      "The reason there is no javadoc for C++ is cultural: Bjarne Stroustrup did not decide that there should be a way to automatically generate documentation from code, and Arnold Gosling did. The task of parsing special comments, which is what javadoc uses to generate its output, is pretty trivial and would not be hard to do for C++."

      The real reason is that C++ syntax is so complex he would have a hard time building the tool. Can you say #define? Now of course there are some Javadoc like tools for C++ but most of them place restrictions on the input. Javadoc does a little more than just parsing comments. It also parses method headers, class definitions. Since C++ uses a macro language rather than language constructs for all sorts of definitions, it is really hard to get decent documentation from the source code.

      --

      Jilles
    3. Re:great by jilles · · Score: 2

      damn, I should have proofread this piece. All the xml was replaced with whitespace. sigh.

      OK, heres the xml with the brackets replaced with *'s you'll get the point:

      *method name="aMethod"*
      *param type="int" name="param"/*
      *block*
      a lot of stuff
      */block*
      */method*

      --

      Jilles
    4. Re:great by jilles · · Score: 2

      nice bold font, enhances readability :)

      "Config files are normally sectioned key value pairs."

      That's nice if you have only a few sections but if you have a lot of them you might want to organize them hierarchically. -> xml does this, ini files don't. Currently the solution for this is LDAP which is also a nice solution. The only problem is that it is a protocol rather than a fileformat. Technically you could probably combine LDAP with XML. It wouldn't surprise me if that already has been done somewhere since it is so obvious.

      Windows ini files were a mess. It is good that MS abandoned them. The windows registry really wasn't a bad idea until they started putting com registration in. Then it became really messy.

      The last thing I want is a localized ini file. What if I move to another place? right I loose all my settings. I want to store my settings on a central place in the network. With personalized configuration files for each program you use, that becomes really messy.

      Database guys figured out years ago that flat files are not good for datastorage. First they invented hierarchical databases and later on they came up with relational databases. After that came object databases and now we have XML (which can be used to store objects).

      So why use XML:
      - rich, extensible syntax
      - standardized
      - easy to handle (it's just ascii)

      --

      Jilles
    5. Re:great by jilles · · Score: 3

      Yes indeed a great idea.

      Using XML would allow us to separate the configuration files from the configuration applications and those could be separated from the applications that are being configured.

      If some effort is made, a generic configuration program (or more than one think expert and novice user targeted software here) could be made that would work with any application that needs to be configurated. I imagine application creators could write an xml file describing all the properties in their application, with documentation included as meta tags. A generic configuration application would read the resource file and present a nice GUI for it. The entered values could be stored in another xml file. The administration possibilities are also way cool. Imagine having permissions on certain properties, default properties and user specific properties managed automatically.

      The advantages are clear:
      - platform independent, possibly even program independent (imagine having a set of default parameters that any app can use) configuration
      - fine grained control on configuration for administrators
      - user friendlier
      - no more obscure textfiles in obscure places on your hardrive, no more .blablabla files in your homedirectory.
      - advanced tools for configuring any application

      Plain ASCII files with fixed syntax are obsolete. The revolutionary thing about XML is not it's syntax, not the way it stores stuff but the fact that you can define extensible syntax structures with it and that you can use generic software to read and write to it.

      In fact I have an idea that may be shocking for hardcore UNIX guys (stop reading if you want to sleep tonight): why not replace the syntax of programming languages like C and Java with XML equivalents. The reason I would want to this is that XML is extensible so you could add meta tags to it. Imagine having author tags, documentation tags (in many flavors), etc in your code. The possibilities are endless. There may be some problems with the grammar, for instance I know that c++ syntax is more complex than Java syntax (one of the reason why you don't find so much tools like javadoc for c++).

      I'd love to see your reactions on these ideas.

      --

      Jilles
    6. Re:great by delmoi · · Score: 1

      In fact I have an idea that may be shocking for hardcore UNIX guys (stop reading if you want to sleep tonight): why not replace the syntax of programming languages like C and Java with XML equivalents. The reason I would want to this is that XML is extensible so you could add meta tags to it. Imagine having author tags, documentation tags (in many flavors), etc in your code. The possibilities are endless.

      Have you ever programmed in java or C/C++? I would think using replacing the standard syntax would be insane. It already works well. Its not like you cant stick a few Meta tags in the comments section, if you want. Also, while XML might be great for describing data in both human, and machine readable format, it would not make a good programming language.

      Scripts on web pages already use the standard C/C++/Java style syntax, and for good reason, people already know it, 'replacing' the language would cause millions of programmers knowledge to become completely obsolete over night
      "Subtle mind control? Why do all these HTML buttons say 'Submit' ?"

      --

      ReadThe ReflectionEngine, a cyberpunk style n
    7. Re:great by ~k.lee · · Score: 1

      no more obscure textfiles in obscure places on your hardrive, no more .blablabla files in your homedirectory.

      This doesn't make any sense. The XML would have to be stored somewhere. My guess is in /etc/something. As for user-specific settings, where else would they go but some .something/ directory in the user's home?

      Plain ASCII files with fixed syntax are obsolete. The revolutionary thing about XML is not it's syntax, not the way it stores stuff but the fact that you can define extensible syntax structures with it and that you can use generic software to read and write to it.

      Such "generic software" already exists for flat ASCII text files. It is called emacs, vi, perl, sed, awk, grep, diff . . . the list goes on and on.

      In fact I have an idea that may be shocking for hardcore UNIX guys (stop reading if you want to sleep tonight): why not replace the syntax of programming languages like C and Java with XML equivalents.

      This isn't that shocking a suggestion, since it's been done. Those who have programmed ColdFusion Server's CFML language, to take one example, already know that XML-based programming languages tend to have heavy, verbose, and annoying syntax because you have to enclose everything in angle brackets.

      One feature of markup languages like XML and HTML is that anything not enclosed in angle brackets is a string literal. This is good when you want to mark up content, but annoying for general-purpose programming. How much of the average program consists of string literals?

      I know that c++ syntax is more complex than Java syntax (one of the reason why you don't find so much tools like javadoc for c++).

      The reason there is no javadoc for C++ is cultural: Bjarne Stroustrup did not decide that there should be a way to automatically generate documentation from code, and Arnold Gosling did. The task of parsing special comments, which is what javadoc uses to generate its output, is pretty trivial and would not be hard to do for C++.

      ~k.lee

      --
      (remove nospam for email)
    8. Re:great by ~k.lee · · Score: 2
      You might want to consider storing it somewhere else though because the last thing you'd want is joe average launching turbo vi to mess up his config file.

      Joe Average will not be launching vi in the first place, and if he goes messing around in his .files (which are hidden by default in ls and most graphical file managers) he has either learned enough to know what he's doing, or will learn the hard way shortly. Putting .files in your home directory is no risk to the newbie because the newbie will not find them in the first place.

      Now that's interesting's I guess those guys were trying their generic vi/emacs editors on XML. Jesus! The idea of XML is definitely not that you open vi and start hacking away.

      Clearly you know practically nothing about software engineering, because if you did then you'd realize that typing in code is only a tiny fraction of the battle. Reading ColdFusion code is as annoying, compared to reading C, as writing it, because of the verbosity. No tool can remedy that.

      If you're suggesting that programmers abandon the source text entirely and start programming using visual tools exclusively, then I've obviously been wasting my time here.

      I wasn't talking about enclosing the original source but rather about replacing it

      So was I. My point was that the following:
      int main(void) {
      printf("hello");
      return 0;
      }
      contains exactly 5 characters of string literal. The rest is actual program content. In an XML scheme, the program content would have to be written something like the following:
      <function name="main" return-type="int">
      <function-call name="printf">
      <param type="string">hello</param>
      </function-call>
      <return value="0"/>
      </function>
      which gains us very little except extra verbosity. If you had bothered to go look up some ColdFusion code on the web, you'd have realized what I was saying.

      I have programmed in an XML-syntax-based programming language. You have not. Please don't tell me how it feels. It's annoying. In fact, it's so annoying that Allaire (makers of ColdFusion) included a <CFSCRIPT> tag in the latest version, which allows you to write JavaScript-like, non-XML code instead.

      The real reason is that C++ syntax is so complex he would have a hard time building the tool. Can you say #define?

      If you really think Bjarne Stroustrup would have trouble building a javadoc-like tool for C++, you need a reality check. C++ syntax is complicated, but compiler authors have had tools (like lex, yacc, bison) for dealing with complicated syntax for years. Clearly, the *compiler* parses C++, so a javadoc-like tool could do so as well. Go learn a bit about compilers (e.g., write one [0]) before you start schooling the rest of us on the complexity of parsing computer languages.

      ~k.lee

      [0] Yes, I have written one. Many CS students do.
      --
      (remove nospam for email)
  61. Re:Jabber and JNX by /dev/niall · · Score: 1
    With the right transports, one could extend it further by having a 'Configuration Repository' for the system, which could actually store configuration data in something like an XML flat file, or even a MySQL database.

    Sounds great, but do you really think MySQL is the right tool for this job? Don't get me wrong, I love it, but it doesn't scale very well, lacks advanced object support, and doesn't support advanced SQL (subqueries, nasty joins etc.) Please folks, do NOT take this as a flame against MySQL! I love it and I'm actively developing a project that depends on it! I just recognize it's (current) shortcomings (as I see it).

    If you're going to have a "configuration repository" why not make it hellishly exstensible and enterprise ready by packing a punch with your (O)DBMS backend?

    And by the way, how the hell are you doin? ;) Long time no talk....

    --
    --
  62. XML already in use by bhurt · · Score: 1

    There is of course, Mozilla and Xul. Also, I think AbiWord uses XML, or an XML subset, for it's (future?) configuration file.

    1. Re:XML already in use by mullein · · Score: 1

      There is of course, Mozilla and Xul. Also, I think AbiWord uses XML,
      or an XML subset, for it's (future?) configuration file.

      AbiWord, according to the FAQ, uses XML as its native file format:
      Why does AbiWord use XML as its native file format?
      Because we like XML. Seriously, it seemed silly to invent yet another
      file format, when XML provides a very nice syntactic structure for our
      use. There are a variety of other options that did not make as much
      sense for our purposes.

  63. Re:Upsides, Downsides... by Christopher+B.+Brown · · Score: 2
    In terms of validation, the killer questions are two:
    • When, precisely, do you require well-formedness?
    • What do you do if the data is not well-formed?

      If this isn't defined, one of the valid options is for us to attach an electrode to your chair and electrocute you :-).

    Why not

    write some integration code to (say) connect Linuxconf to XML so that it could manipulate any XML file?

    That is an interesting idea; two problems:

    1. XML is just a data format.

      The tools presently available are generally parsers, and have nothing to do with the grotty work of file locking and error detection/correction.

    2. libPropList is a format that exists now, and is already used for configuring programs like WindowMaker.

      As such, it would represent a useful inclusion into Linuxconf.

      At some future time, when there is actually some useful configuration information managed in an XML repository, and when there is a scheme not only to read, but also to reliably write, XML, it would then prove to be a useful inclusion.

    Until there is something of comparable functionality to libPropList for both read and reliable write, I'll remain skeptical of the usefulness of XML for storage of configuration information.

    --
    If you're not part of the solution, you're part of the precipitate.
  64. Avoiding Binariness by Christopher+B.+Brown · · Score: 2
    Yes, there is great merit to making sure that there is indeed a text form, and, preferably, having it be the official form.

    If there is a lot of data, as might be the case for things like mail routing tables, there is also merit to having a random access mechanism so that the data doesn't have to either be stored in memory or parsed repeatedly.

    This is one of the merits of the CDB system; it provides a "binary" form that is rabidly fast but which also can be rewritten from scratch with exceeding rapidity.

    Approach that supports both needs:

    • When the program that uses the file starts, it "compiles" the text form into binary form.
    • When the user signals via SIGHUP, the program "recompiles."
    • If the program detects, via date stamps, that the files are out-of-sync (ala "make"), it "recompiles."

    The two merit to CDB in this regard are that:

    • CDB is really, really, really fast.

      I once "compiled" a file into hashed form, and got about a million keys inserted in 17s on my PPro box.

    • CDB does not permit rewriting the DB, as it uses perfect hashing.

      There is no temptation to change the binary form, as you can't modify what has already been written out to it.

      This means that the text form stays as the true data source.

    Noticing that the system needs to "recompile" is the one "problem issue" here; it is not exacerbated by this approach as it would be equally true for a purely text-oriented scheme.

    --
    If you're not part of the solution, you're part of the precipitate.
  65. Agreed. by Christopher+B.+Brown · · Score: 2
    (He spelled "moot" right! Obviously not clueless...)

    Yes, indeed, it would be a monumental effort to get everything in /etc rewritten to use a set of XML-based data files.

    The big deal is not merely that of getting something working, but also to ensure that a robust system results. As you say, "what if ... it is corrupted or incorrect?" The XML standard provides no guidance here, and there are liable to be three answers, not one, which will muddy the waters further.

    --
    If you're not part of the solution, you're part of the precipitate.
  66. Libraries to reliably write XML? by Christopher+B.+Brown · · Score: 3
    The XML libraries that I am aware of are parsers that generate parse trees, that is, providing read access.

    Are there some that do reliable write, e.g. with file locking, backups, and automated backout if it encounters errors?

    --
    If you're not part of the solution, you're part of the precipitate.
    1. Re:Libraries to reliably write XML? by Fastolfe · · Score: 2

      Don't know. I've never used them for writing XML.

      Do a search for XML at FreshMeat and test some of the implementations out. If they don't have support for the reliability mechanisms you state, request or add them yourself.

      I believe most of these libraries just generate the XML text and more or less rely on the application to write it out to file, so you pretty much have as much control to be as reliable as you want.

  67. Upsides, Downsides... by Christopher+B.+Brown · · Score: 5
    The merit of using XML would be that there are a whole host of XML parsers out there, as well as a whole lot of hype.

    However. It is not all fine and dandy.

    The "configuration problem" has not one issue, but several:

    • The proliferation of "little languages" as formats.

      XML represents Yet Another Format; it is of value if it pushes out some of the existing formats. If it merely augments the population with another, there is no win here.

      Result: Ambiguous. XML might provide value.

    • The Serialization/Locking Problem.

      The issue here is that you need to ensure that the configuration is written out correctly.

      This may require writing out the new config to a new file, validating that it is readable and correct. (Oops, made a mistake updating /etc/inet.d. Now the system won't reboot...)

      There is merit to having a "database form" ala IronDoc where the physical representation is a database system, which provides a somewhat different persistence model than the typical text file.

      (Before people start proposing that I be shot, I tend to favor the notion of, if using a binary format, synchronizing it carefully with a text format.)

      The merit of a "databased" scheme, which should provide a separate database for each facility, is that updates can be implemented "instantly" without needing to rewrite a whole file, and without a need to parse the file. Note that even in a situation where XML is used as an interchange format, there is still merit to storing the "tree" in database form. David McCusker, author of IronDoc and architect of the (regrettably failed) "Bento" database system that was part of OpenDoc, suggests this very use for IronDoc.

      For those that feel religious about using text files, a system like libPropList still has merit over the "let's do something with XML" idea since it has, already debugged, the locking, parsing, and config-file-rewriting code that let's use XML, it's k001 doesn't inherently provide.

      In short, deciding to use XML merely establishes a format; it does not resolve that:

      • Updates are managed well
      • The output from a particular program that manipulates a config file actually produces valid XML
    • Federating Configuration.

      Michael Stonebraker (of fame with such developments as Ingres and Postgres) has most recently founded a company called Cohera based on the Mariposa Distributed Database Management System. This tool allows many databases to work together to process queries.

      The "obvious" implication of this with this thread is that a valuable thing to be able to do is to join together many "databases" that are configuration repositories, and provide a central way of getting at the data.

      The critical thing that is necessary is for configuration repositories to provide some sort of "metadata" so that they, in effect, publicize their existence.

      A "federation" tool like Linuxconf, Ganymede, or such, can then be used to join together the metadata and manage it all together.

      Unlike the situation with the infamous Windows Registry, this doesn't force all the configuration data into one fragile binary DB; it allows the data to stay wherever it was concluded that it should reside.

      The critical factor here is not that data files all have a common format; it is that there be some way of translating their data into a common format.

      XML has a lot to offer here in terms of providing a central "presentation" format. It could offer more if tools were available to make this a two-way street, where updates done to the central XML could be pushed back to the individual configuration data repositories.

      However. If someone writes some integration code to (say) connect Linuxconf to libPropList so that it could directly manipulate libPropList files, that would also represent a movement in the right direction.

    Conclusion: XML may have value to offer in confederating config information.

    That has to come along with a whole lot of coding effort to build robust configuration data repositories that may or may not use XML.

    --
    If you're not part of the solution, you're part of the precipitate.
    1. Re:Upsides, Downsides... by Fastolfe · · Score: 2

      So long as a competant library exists to act as mediator between an application and an XML file, things should be fine. To the best of my knowledge, existing XML libraries do perform these tasks, and well.

      XML isn't terribly difficult to represent with data structures. Thus, so long as you have valid data structures in memory, it shouldn't be much of a chore to write that out in a valid XML file.

      Now, if the program poorly represents what it wants in a badly-constructed data structure, that XML, while perhaps valid XML, might not be exactly what the author intended. Unfortunately, there's not much you can do about it. A crappy programmer is a crappy programmer, and the author would probably just as easily foul up a plaintext configuration file.

    2. Re:Upsides, Downsides... by V-1138 · · Score: 1
      While it is true that XML is a data formatting language, its functionality extends greatly beyond that in ramifications.

      I would argue in favor of ascii config files over binary config files. I will not elaborate why...maybe its a religious issue. I just wanted to point out that file locking and format correctness are issues that haunt both ascii and binary file formats and that validating XML is easy because you can require it to be well-formed.

      And in response to If someone writes some integration code to (say) connect Linuxconf to libPropList so that it could directly manipulate libPropList files, that would also represent a movement in the right direction. Why not "write some integration code to (say) connect Linuxconf to XML so that it could manipulate any XML file with on-the-fly GUIs?"

      As for the other software/data options people keep proposing; sometimes things need rebuilt, sometimes they dont -- sometimes we just need something new.

    3. Re:Upsides, Downsides... by V-1138 · · Score: 1
      the data would need to be well-formed at the time of change -- waiting until the data is needed would be too late. Secondly, what do you do if your configuration file (in its current manifestation) is corrupted or incorrect? Rhetorical question...

      The point is largely moot. A developer can decide whether or not to his/her app will use an XML based config file -- perhaps a small cult of developers will decide this is how it should be done. But to handle the contents of /etc? That would take a monumental effort -- everything from login to bind to inetd would need to be rewritten. At that point, it would be better to step even further back and address the problems as "how to better design?" as opposed to "how to better piecemeal?"

      "The Devil's Advocate has a less heard of, but tastier Foodcake" -- versil

  68. Re:Possible Pitfalls of XML by jafac · · Score: 1

    Just to pick nits here, the Windows registry IS NOT a single, monolithic file. On NT, it's the contents of \winnt\system32\config, a bunch of files.

    Of course all the other things you say do apply, and in fact it makes no difference, it's still an impenetrable black box, and irreparable given a basic text editor or shell (DOS) commands as your only tools.

    "The number of suckers born each minute doubles every 18 months."

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
  69. Re:XML Everywhere (soon) by jafac · · Score: 1

    Thanks for all the information, but it still doesn't explain: what does XML DO?

    Does it replace JavaScript?
    Does it replace Java?
    What is required to implement it - a web browser that "does" XML? - an office app (like Word or StarOffice) that can parse XML and execute it's "commands"? Is it a programming language? If so, do we consider it to be an "interperated" language? I really don't understand it's use for doing configuration files - though your explanation of what XML is is the best one I've read so far. (most explanations, including the dissapointingly LAME-ASS one in Scientific American, simply say - it's a way for people to create their own extensions to HTML - without saying anything about how those extensions are implemented or acted on, and how a specialized extension is used on a system that doesn't know the extension (platform-specific code? browser plug-in? what? how?)

    "The number of suckers born each minute doubles every 18 months."

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
  70. Re:XML Everywhere (soon) by jafac · · Score: 1

    But in order for those specific definitions to be useful/renderable/recogizable on everybody's system, some piece of code somewhere on that system has to know what those tags mean, and knows how to do the specific things that that tag requires - and that's where I'm having a problem with realizing the usefulness of this technology. How do you get that code onto your client's machine, and why is it any more useful than Java?

    "The number of suckers born each minute doubles every 18 months."

    --

    These are my friends, See how they glisten. See this one shine, how he smiles in the light.
  71. Re:Eschew Buzzword Based Planning - Correct! by Fastolfe · · Score: 2

    Someone else mentioned the likelyhood of, say, a /usr/lib/sgml-like directory where system-wide XML configuration files would be. An alternative could be /etc/sgml, /etc/xml, /etc/config, whatever.

    The point is that if we establish a standard system-wide configuration path, it would be pretty easy to do what you're describing using traditional remote FS techniques.

    If you wanted some apps to be remotely configured and some locally configured, create an /etc/sgml/remote and an /etc/sgml/local and update everyone's $XML_CONFIG_PATH appropriately.

  72. Re:ASCII, not XML by Fastolfe · · Score: 2

    In addition to the other poster's comment that you can use < to represent < and > to represent >, you can also simply use the "Extrans" posting method (versus "Plain Old Text"), which automatically does these conversions for you.

  73. Developer doesn't necessarily have to learn XML by Fastolfe · · Score: 3

    Like another poster said, so long as they have a basic grasp of the XML libraries that exist, it's just a matter of calling the library's parse and write functions to read and create your own application-specific XML files.

    Though learning XML would most certainly be a huge advantage, but it's hardly necessary. It's pretty easy for a non-XML-savvy person to edit an XML configuration file. It's not too difficult to figure out.

  74. Re:XML and config files by Fastolfe · · Score: 4

    A libxml already exists. In fact, most languages already have some sort of library support for XML.

    The support is there, the libraries are there. It's just that there's no "config file standard" yet and developers haven't really looked into it.

  75. Re:Shameless Plug, but Interesting you should ask by Thomas+Charron · · Score: 1

    Once it comes of maturity, we'll be looking for uses within the Jabber project, http://www.jabber.org

    --
    -- I'm the root of all that's evil, but you can call me cookie..
  76. Re:Jabber and JNX by Thomas+Charron · · Score: 1

    Was simply an example.. ANYTHING could be used to store the database, merely used MySQL becouse of the typical slashdot reader.. ;-P

    --
    -- I'm the root of all that's evil, but you can call me cookie..
  77. Re:One more thing.... by Thomas+Charron · · Score: 2

    Not really.. With the XML wrappers out there, it's be fairly easy to parse in a file, and get the data from it. For general configuration data, this would be rather simple, becouse it's normally just key=value pairs..

    --
    -- I'm the root of all that's evil, but you can call me cookie..
  78. Jabber and JNX by Thomas+Charron · · Score: 4

    One project that will eventually come out of the Jabber IM project is JNX, which would be expanding certain *nix functionality with XML data storage/routing. This actually goes one step further, and allows any program to transfer data to any other, by sending XML 'streams' of data. With the right transports, one could extend it further by having a 'Configuration Repository' for the system, which could actually store configuration data in something like an XML flat file, or even a MySQL database. Imagine 100 *nix desktop systems, all controlling their configuration via XML and a centralized database. This is some of the things that we will be looking at within the next year or so. www.jabber.org

    --
    -- I'm the root of all that's evil, but you can call me cookie..
    1. Re:Jabber and JNX by eries · · Score: 1
      This actually goes one step further, and allows any program to transfer data to any other, by sending XML 'streams' of data.


      Sounds like a great idea. In fact, why not build a tool that could use the configuration information in a database to generate legacy config-files in the fly. Sure it would be annoying, but only one person would have to write down the style of the, say httpd.conf, file once. This way, every app does not need to be rewritten.

  79. Re:Bye-bye grep and text tools by Matts · · Score: 2

    The version of awk that handles XML data is called Perl. I thought you'd heard of it :)

    And then there's sgrep.

    Damn all these tools for moving us into the 20th century.

    perl -e 'print scalar reverse q(\)-: ,hacker Perl another Just)'

    --

    Matt. Want XML + Apache + Stylesheets? Get AxKit.
  80. NetInfo by Chris+Hanson · · Score: 1
    Sounds like what NeXT has been doing with NetInfo for years. It's a distributed configuration database. Between NetInfo (for centrally-administered machine configuration information) and the NSUserDefaults mechanism (for end-user configuration information) you could implement roaming support pretty easily.

    NetInfo is part of Apple's Darwin and thus Open Source now. I believe someone's even ported it to Linux.

  81. XML for Games by Bryce · · Score: 3

    The game project I'm working on uses XML for its network protocol, its database stuff, and (some) configuration scripts. We've explored a lot of the available parsers and run into some issues but no major sticking points. The two key issues:

    Streaming - To use XML across the web it is nice to be able to stream XML packets (e.g., object definitions) and collect them client side and make use of them in real time. None of the current parsers provide this adequately, although several are working on it. We had to develop our own library for streaming this stuff (libAtlasWF). It's focused mostly on real time 3D information transferral, customizable by receiver to filter out unneeded information. It's generic enough to be useful for a wide range of applications, though we're using it for game systems.

    Binary - A major requirement for games (and other applications) is binary formats for performance reasons. This was a major argument against XML until we realized that the XML tags (and lots of the data) could be rendered in binary simply by replacing tags with particular bytecodes and such. Probably not as compactly efficient as a custom binary code, but extraordinarily flexible (e.g., develop in ASCII XML, then just flip a switch to go to performance-oriented binary, and redefine binary tags as needed).

    We're calling this real-time, 3D, binary-ready protocol "Atlas". We'd love your input (and help) in bringing it to any application that could use it. We invision client applications that understand XML-Atlas and can communicate with any server talking in this language, and a variety of specialized servers doing the same.

    Here's some links to information about Atlas: Atlas Version 1.0, and WF Protocols

    Bryce

  82. Use LDAP to keep config files (in XML format) by vinod · · Score: 1

    Isn't there anybody who is interested in accessing their configuration files over the net? Rather than require that most applications use XML parsers and input from XML files, we should have a common, internet wide, infrastructure which will:

    1. Allow you to store all your configuration files in a common store accessible over the internet (and with appropriate access controls)

    2. Be able to use each others configuration files as example templates

    3. Provide a uniform mechanism for a user interface programs (such as linuxconf) to manipulate the configuration.

    4. Allow all linux clients on a network to use
    common configuration information from central server.


    XML will obviously be a candidate for holding the configuration information (the HOW part of it) and LDAP will be appropriate for WHERE part of this infrastructure. I would make my configurations accessible using my own LDAP server; and allow myself to use my configurations from other systems on internet.

    We could have a freshmeat-like repository for this purpose, and allow people to upload their configurations (as templates) when appropriate. (Examples of such templates are configuration files for packages such as mutt, .bashrc aliases and so on.)

    The package specific offline tools can be created independently by each package owner (who will also decide the DTD).

    -Vinod

  83. Linux the Kernel. by jelwell · · Score: 5

    It seems the poster wants XML introduced into all applications - not really the Kernel. I don't know many places where the Kernel would benefit from XML - except for the one configuration file the code itself wouldn't need XML.

    I think what is being addressed is more an application issue. That would need to be addressed to many different vendors simultaneously. For instance: Apache config files, WuFtpd/ProFtd/etc files, Gnome/KDE config files...

    I could see a lot of reusability for a config file parser for application development. But it would seem like the development tools would need this XML ability and not just everyone using XML. But I imagine that C/C++, Perl, Python, Java, etc already have XML parsers/creators. So really people are waiting for developers to embrace XML.

    Does anyone now embrace XML? What are the advantages of XML over other config file parsers? Are there other standardized config file parsers? I know I've written my share of wheels in different languages for parsing config files.

    Joseph Elwell.

    1. Re:Linux the Kernel. by Ed+Avis · · Score: 1
      I don't know many places where the Kernel would benefit from XML - except for the one configuration file the code itself wouldn't need XML.

      You could have things like /proc/cpuinfo in an XML format. I can also imagine that in five years' time, things like the wire protocol for distributed filesystems will be in XML. Yes, it would be less efficient, but probably easier to code, more robust and more forward-compatible (discard elements you don't recognize). If you just had the 'header' or metadata in XML, and not the file data itself, the performance loss would be small.

      --
      -- Ed Avis ed@membled.com
    2. Re:Linux the Kernel. by bigdawg · · Score: 2

      I think jelwell just touches on what is really needed. I agree that overall a standard config setup is needed (just as standard file locations are needed). Now I'm no fan of the Windoze registry but something similar could be implemented using xml in linux.

      We need a standard config database setup so that people can develop tools for (insert your favorite windowing envt here) to ease the configuration headaches that most users experience. Don't get me wrong, I like the flexibility of text based config files and I'd hate to be forced to use only one tool (like regedit.exe) but a central repository in a standard format would be a boon to sys admins everywhere.

      --
      "He flung himself from the room, flung himself upon his horse, and rode off madly in all directions." S. Leacock
    3. Re:Linux the Kernel. by blahedo · · Score: 1

      The idea of the Windows registry is actually a pretty good one. It just went horribly wrong in storing the configurations for everything in one file. If anything happens to that file, you're SOL. (Have later Windows versions fixed this to any degree?) But it got a few things right: it's a centralised location to store your configuration info, and it can be edited by hand if necessary (though because of the aforementioned corruption problem, this is not recommended for the faint of heart!).

      Applying this idea to linux would be fairly easy. Just have a directory ~/.config that contained lots of files in XML format for configuring the systems. By having a separate config file for each program (and perhaps several for some of them!), you mostly avert the corruption problem. There is still the issue of a namespace---if you and I both make a program that wants a "foorc.xml" file, who wins? But there we could take a page from Sun's java convention: until we write a package that gets "blessed" (presumably by an RFC?), we store our configs in a reverse-domain hierarchy. Thus config files for packages I wrote would be in $HOME/.config/edu/brown/cs/dpb/, or something similar. If people want more convenient access, they (or even I) could install a symlink directly into ~/.config---if that got clobbered with another symlink, data wouldn't be lost.

      All in all, having a "Registry" would be a very good idea. Don't let the bad micros~1 implementation scare you off from a fundamentally good idea.

      --
      ``This, too, shall pass.'' ---Eastern proverb
    4. Re:Linux the Kernel. by Belette · · Score: 2

      As far as I can tell, XML config files would not give you any benefits as far as actually reading config files (ie, efficiency). The true benefit comes from (ideally, of course) having all of your applications store their configurations in a centralized place and in one format. This would allow the user to have one centralized configuration tool to change the settings for every application on the box (like MS's attempts with their Management Console.)

      belette

    5. Re:Linux the Kernel. by nellardo · · Score: 3

      I think using XML makes a fair amount of sense. It can be relatively human-readable, even in raw character form (a trait shared with HTML that focuses more on semantic mark-up and less on graphical design). And perhaps the best part about it is that you don't have to write a new parser, unless you really really want to. Lots of them exist already in a wide variety of languages. All you have to do is agree on a DTD.

      Furthermore, it has the potential to support a variety of useful tools, such as the following:

      • automatic construction of build instructions,
      • informative directions on how to fix your system if you don't have everything you need (or even an ability to automatically download what is needed), and
      • automatic correction for newer package versions.

      As there are compiled versions of XML tools out there, and XML is sufficiently high-level that programs that manipulate XML are readily written in commonly compiled languages, the XML tools stand a good chance of being faster and more efficient than the present interpreted tools. And if you don't want to build the XML tools, there are script-based XML tools as well.

      --
      -----
      Klactovedestene!
    6. Re:Linux the Kernel. by Murray · · Score: 1

      Perhaps the Xml standard would create a new type of windows management standard that provides complete html interfaces and java(or python) support. integration of Dhtml and all the other *ml standards into the existing window managment software would simply be to much work. Im sure microsoft had the same idea with windows 98, but if they had started from scratch instead of altering bits and peices of the existing 95 code they would have had a killer system.

      --
      Sure Im A Lemming - But Ive Got Teeth
  84. XML vs Unix Philosophy by Frank+Sullivan · · Score: 4

    IMHO, the *real* win of XML is not in replacing plain-text configuration files, but rather in replacing binary file formats and simple databases. One example would be word-processor file formats, which are usually a poorly documented, poorly structured binary mess. XML makes sense there. Another example is the Windows registry.

    But XML is a significant *disadvantage* for the plain-text configuration files that dominate the Unix world. Generally, those plain-text files have a comment mechanism to clearly explain what needs to be edited. Adding XML will just add a bunch of unnecessary tags that will make it difficult to hand-edit configuration files - and the ability to easily hand-edit the human-readable configuration files is one of the most powerful advantages of the Unix Philosophy.

    What i would like to see in the Unix/Linux world is a GUI that is capable of managing the entire OS via simple graphical tools, but doesn't *prevent* hand-editing of configurations. I don't see XML as a significant boon in that regard.

    ---
    Maybe that's just the price you pay for the chains that you refuse.

    --
    Hand me that airplane glue and I'll tell you another story.
    1. Re:XML vs Unix Philosophy by Anthony+Kilna · · Score: 1

      You make it sound as if its impossible to write XML-enabled command line or ascii-based "gui" programs. What would be the difference in your ability to administer if you a.) used vi to edit the files or b.) used a terminal-based xml config program that allows you to edit to the same level of granularity? I'll take the liberty of giving you the correct answer: You actually would have an *advantage* with the XML-based system, because using a standard configuration editor and parser means a stray keystroke during editing would be *less* likely to make your system even worse after making your changes. Yes, you can make the argument that "well written" plain text config parsers should behave the same, but leveraging a standard format with community supported tools makes sure every program that supports that method of configuration is "well written", and with less effort on the developer's part.

      --
      s/[BW]ill(y|iam)?( H\.?)?( G(ate|8)(s|z))?(,? ?v?(III|3)(\.\D)?)?/Girly-man/gi
    2. Re:XML vs Unix Philosophy by Zurk · · Score: 2

      heh heh. well said. i couldnt have phrased it better. simplicity is the name of the game here people. unix relies on simplicity and elegance for speed and performance.

    3. Re:XML vs Unix Philosophy by BenRusso · · Score: 2
      I agree with Frank for the most part.


      From a UNIX system admin of 5 years with dozens of various platforms under administration: BAD IDEA, BAD IDEA, BAD IDEA!!!! I have to explain to all of my managers why NT is impossible to remotely manage because there is no way to connect to the console of the machine remotely if there is a network problem or the system becomes unstable.


      OK OK, there are third party product that allow "telnet" access to NT, and most UNIX's come with a Remote Service Processor, and even Linux can be configured with a modem and you can set that modem to be the CONSOLE with later kernel's.


      Now, explain to me how I can change configuration files while accessing these machines over a terminal? I can't use the GUI over a console connection, and launching GUI's via modem's sucks.
      How can I know ahead of time that the machine I will be using for remote access will even have X windows???


      Most of the machines I maintain don't even have a monitor on them, nor a keyboard, and I don't have X installed on them at all.


      I don't want to have to enter TAGS around all my text and remember XML rules. I am not a webmaster, I am a sysadmin.


      I don't even like most GUI admin tools because they don't follow the syntax rules for files and end up stripping out or relocating comments. They usually don't have the flexibility of "command line" interfaces which is what a config file really is all about, it is a batch of preformated command arguments.


      PLEASE PLEASE PLEASE DON'T USE XML for fomatting config files. Leave them in plain text so I can access them from my PALM PILOT MODEM when I get paged at the beach. Or I can access them from the UNGODLY poor MS Win/NT Telnet client if I have to use someone else's machine to connect to them.


      Linuxconfig is a great tool for all those people
      who don't need very fine control over their config files. It offers basic control of all config's and is centrally located. It also gives those of us who don't want a config GUI the option of not installing it and using the plain text we want.


      A very concerned Linux and UNIX advocate.
      -Ben.

    4. Re:XML vs Unix Philosophy by AnotherGuy · · Score: 1

      I agree entirely. Leave XML in the document world.
      Don't rewrite applications which already work. Use
      XML for new applications based on documents. Think
      groupware, think document database applications.
      How could XML help reorganize a groupware application -- like a news server? Why doesn't
      someone write a GPL Open Source application which
      is the equivalent of Lotus Notes using XML?

      Forget about configuration files.

  85. Re:XML and configuration systems... by Digital+Commando · · Score: 1

    Yeah, why not GUILE instead? Stallman is right when he says (I paraphrase) that most scripting languages (and configuration languages) are simply poor implementations of Lisp. What needs to be done is to take the *semantics* of a language like Scheme, and get rid of the damn parentheses. :-)
    Actually, I kind of like Mathematica; the notation is related to the original M-expressions for List (see Guy Steele's "The Evolution of Lisp").

  86. The CD Index uses XML by mvw · · Score: 1
    Check this link to see what the CD Index project is using to build a free Internet CD database.

    An extension to add Karaoke/sub titling should be found here. I say should, because the link does not work right now (strange), so I provide a link to this mail. This should give you a basic idea until the link is working again.

  87. One more thing.... by Wiggins · · Score: 2

    Don't know much about XML but it would be one more thing a person would have to learn before they could begin to write an app worth using. Could go either way, should improve the software that is developed, because you wouuld have to know all of the tools. But it might also deter some good programmers who don't want to learn/don't have time to learn/or are to stubborn to learn a new way of doing things. It might still be easier to parse your own config rather than including a library and learning how to use it.....

    --
    Funny and I thought Perl == Paid employment recently located ....hmmph.....
    1. Re:One more thing.... by Tekhir · · Score: 1

      If the XML parser is put into the OS somewhere, then the application a request for a certain piece of information and waits for that to be sent and request again.

  88. Re:Mozilla uses JavaScript config by linuxci · · Score: 1

    Mozilla currenly uses Javascript style configuration files (prefs.js) which are basically the same as the ones used in Netscape Communicator. So I don't see XML config files in the forthcoming Mozilla release, however Mozilla does support XML so it could be a possible configuration file format in the future if anyone actually feels it will be of benefit.
    --

  89. Re:XML and config files by kzin · · Score: 1

    Maybe an XML front-end to existing configuration file?
    I mean an XML file format that describes existing configuration files, so that the new XML-based configuration tool will be able to access old files as well in the same environment. I wonder if that's possible...

  90. Re:Good Idea by gigi · · Score: 1

    okay, add also: /etc/hosts smb.conf and in comes instant remote management!

  91. Re:Eschew Buzzword Based Planning - Correct! by heller · · Score: 1

    Absolutely Correct!

    Right now XML is "the thing" (TM). Does that mean it's viable for all applications? No! Is it viable for this? Who knows, but lets not jump into it before it's been tested!

    There certainly are advantages, but they've been mentioned so I'll skip 'em. On the other hand, there are a good number of disadvantages. Things like: larger data overhead in the conf files, Less readability in conf files, progammers would need to learn XML (which many of us don't want to!) and XML might not be adequate for everyones needs.

    That being said, if you wish to proceed, pick an app and convert it to using XML conf files. See if it goes over.

    However, one thing I would love to see is a unified method of getting config info, regardless of file format. Something along the PAM lines so admins can just drop a module in and suddenly the linux box can draw all of its config files from a central server! As an admin, I'ld love to be able to configure all aspects of every linux box I admin from a central server.

    ** Martin

  92. XML and Linux: a new distribution by bgarrett · · Score: 2

    I've been working on ideas for a new Linux distribution (yeah yeah, flame on) that's based around CORBA and XML: backend objects convert a normal program's configuration files into XML and back again, communicating with whatever frontend program you want to write (a java applet, a command-line program, a GUI, whatever). So Apache's httpd.conf gets rendered into XML, the XML gets edited (by whatever means), then the edits get handed back and the backend program converts it back into an httpd.conf file.

    There are three specific advantages to this, as opposed to making every program use XML for its configuration:
    1. Some programs are just optimized for a particular parsing style. Apache's needs differ from sendmail's, which differ from inetd's. There's no reason each program needs to use XML internally.
    2. It's backward compatible. My hypothetical distribution wouldn't need to make major patches for every new release of every daemon in existence. It's also forward compatible, because it doesn't require new daemons to use XML either.
    3. It doesn't piss off the "tomsrtbt and vi at 3 am" people, who either by necessity or choice want to be able to hack directly on configuration files.

    Does this turn into a "Windows Registry"? No. The only differences between Linux and the Registry is that the Registry is binary, and that it's all in one place-- Linux configurations are scattered all over. This method lets you edit all configuration files using a single tool, but it doesn't give up the ability to hand-edit files if necessary.

    The other application XML has in this distribution idea is for package management. Instead of a proprietary format (RPM, DEB, whatever), we have an XML "manifest" or "spec file" in a tarball along with the relevant files; the XML file has a well-defined filename, and tarballs can be created anywhere, without installing any additional software. This doesn't burden software developers with the need to make special arrangements for binary distributions; by including such a spec file with their normal source distribution, they've effectively created an "SRPM" without any additional effort. If they want to package up binaries as well, more power to em; otherwise, someone else can.

    --
    Nothing worth doing is worth doing today.
  93. de-commoditization awaits XML by ratman · · Score: 1

    now, a GNU reference implementation of some XML DTDs would be nice. without it, XML is another hatchling produced by commercial vendors. The point of XML is to separate you, the buyer, from your current technical commodities (eg: ASCII, HTML). that's just my opinion.


    --
    How can they feel the rain but not know of the flood?
  94. Interest in a mail list/site? by elemur · · Score: 1
    If there is interest in a follow-up mailing list or site for discussions on this topic, let me know and I will create one. This would be a good conversation to continue.


    I think it would be interesting to look at standardizing some baseline configuration files, or to explore if this sort of consolidation is possible. Given the number of XML parsers out there (in C, C++, Perl, Python, Java, etc..) it should be reasonably easy for people to use this in their own applications.

  95. Re:Linuxconf? by SimonK · · Score: 1

    Linuxconf is not very good. It also needs modifications (or maybe it has modules of some kind ?) for every new tool you want to add.

    A suitably general DTD for application configuration would allow a single tool to read the config file for an app, generate the appropriate GUI, and let the user mess with the configuration.

  96. XML is good for configuration by Nelson+Minar · · Score: 1

    I think XML would be just fine for configuration. If nothing else, it would help us standardize on *one* comment style in tool configurations. Right now, I have to guess - is it #, //, %, or what?

    The biggest problems are that XML adds more verbiage, a good DTD has to be designed, and a bunch of tools have to be hacked to understand the new format.

  97. XML dreams (offtopic, I know) by os10000 · · Score: 1
    I want:
    • a program that takes a BNF grammar and a file conforming to the grammar. It would return an XML parse tree of the input that contains the DTD as its header
    • an XML format for emails
    • simple XML formats for letters/faxes
    • a convertor that takes this and turns it into usable latex/MSWord
    • a dream-reiserfs based repository with set based access
    • a command line client that produces orders of the form (address, (quantity, product_description, product_number, price)*, max_invoice_price, (payment_details)) and encrypts this with a public key scheme, turning it into email
    • a gtk/qt/athena/xxx based front end for this client (not for me though ...)
    • an BSD-style licensed parser that works on Windows and extracts this, so that bookshops (or whatever) can easily sell to me even if they're assimilated into the borg
    • an extensible from-and-to convertor that can gather all the config files around my hdd and turn them into one big XML file and back (that's more to the topic)
    • DTDs for emacs bbdb/cal/todo
    • convertors to turn emacs-bbdb/cal/todo files into XML and back
    • An XML merge utility to merge two files conforming to the same DTD
  98. Semantics and XML by lutter · · Score: 1

    It's very tempting to hope that XML will solve all the problems that config files cause. I don't think that it would get us that far.

    The main purpose of XML is to add machine-readable semantics to data by marking that string up as an address and this string as a last name. To create the grand unified config DTD, we would need to describe the semantics of all those config files in a grand unified way. For simple config files of the key-value type this would be great: mark the key 'background' as <COLOR> and the config file editor knows that a color chooser needs to be popped up. A config DTD would at least relieve the burden of writing yet another crummy key-value parser and make all kinds of config editors possible.

    For other kinds of config files this seems very hard. For one, many config files are really written in some kind of (often braindead) language: think of sendmail.cf or procmail files or .emacs files. Each config file is really a program in a language that can at least do ifs; it would be great to replace all this little languages by one consistent language, but that replacement would help the computer little to understand the semantics of the config file - and therefore no go for the grand unified config editor.

  99. Re:Why not SGML? by r39525 · · Score: 1

    XML is just SGML with a few esoteric, seldom used functions removed that make XML easier to parse.
    Also, XML permits "well formed" documents to be parsed without the need for a DTD.

    You can use all the existing SGML tools to read and write XML as well.

    In short, I think XML is more useful than SGML because it is simpler and a little more permisive.

  100. Re:XML Everywhere (soon) by r39525 · · Score: 1

    It isn't more useful than Java. It gives Java something to do!

    XML is used to define the syntax of a data format. Someone must write some code to add the symantics (meaning).

    Java has syntax and symantics. The syntax defines how you may put characters together into a file that the parser section of the Java "compiler" will accept as correct. For example that "a = a + 1;" is a correctly formed Java statement.

    The symantics of this statement is given meaning in another part of the Java "compiler". It is this part that generates the byte codes that will cause the value stored in the variable "a" to be increased by one.

    XML is used to define only the syntatical part of this duo. It is left as an execsize to the student to create the software to add the symantics. The fact that XML parser libraries are avaliable just makes the job a little easier, but there's still plenty to be done to have a complet and useful system.

    Don't get caught up in the hype. XML is, IMHO, just another tool in our arsenal. Only use it if it makes sense.

  101. Database config works great under FreeBSD by Admiral+Burrito · · Score: 1

    If XML were used with wrapper classes to access conf files some people might be tempted to port those conf files into a database and change the wrapper library to a database wrapper instead.... to a naive user (how many of these are there now?... but in 5 years?) there would be no difference. [...] A database system may look nice from the outside and have lots of great features, but when something goes wrong and the settings for your favorite daemon are in a corrupt database entry what are you going to do?

    FreeBSD already uses a database system for information from /etc/passwd to improve performance on sites with a large number of users. Parsing a ten thousand line file every time you want to login, print username for ls/ps/etc. is not very efficient design. Databases solve that problem.

    The /etc/passwd and /etc/master.passwd (shadow passwords) are there as usual, but there are also /etc/pwd.db and /etc/spwd.db. You make your changes to the regular password file and then run pwd_mkdb. Vipw, chsh, etc. handle this automatically. The getpwuid and getpwname functions in libc read the database version, providing a real improvement on systems with a large number of users.

    I haven't heard of any reliability problems with this system, probably because vipw does proper locking of the database, and if the database ever did get corrupted it's easy to run pwd_mkdb to rebuild the thing from the traditional text files. The regular /etc/passwd files also provide backwards compatability for programs that don't call the database-using libc functions.

    FreeBSD (and probably other BSDs as well) made this change a long time ago and haven't looked back. It really does work well.

  102. Microsoft by matt[0] · · Score: 1

    I have been working with XML pretty much since it's inception, having been involved in the development of the first viable internet XML Search Engine at http://www.goxml.com. While we are totally a Linux/Unix shop, we do recognize that Microsoft is actually doing a good job of pushing the XML Development envelope. A lot of the time many of us are really frustrated with the slowness of the w3c in making a technology standard. M$ is just really anxious to use XML and are not prepared to wait on the w3c for everything. It is also interesting to note the the w3 org is basically an industry consortium, of which m$ is a major delegate, their "Bastardizations" may in fact become de-facto standards, mainly as a result of early adoption of their extensions (xml-data, schemas). Their "BizTalk" initiative marks a big change in their strategy, they are actually moving toward an open document exchange standard. The fact that they make money from it by selling biztalk servers is beside the point, as you are totally welcome and free to make one yourself. Give them a break, I know for a fact that the Microsofties are not all puds.

    --
    --------- Matt
  103. Re:XMLTP by matt[0] · · Score: 1

    Here is an idea, don't reinvent the wheel. http://www.biztalk.org. Like M$ or not, it is a solid standard, and a perl api will be out soon.

    --
    --------- Matt
  104. We need a CORBA interface by qseep · · Score: 1

    XML is a wonderful thing, and would be far superior to the current way we store configuration files (haphazardly) in Linux. However, binary files may have an arguable advantage - space and speed. I don't know why everyone is so opposed to copying the Windows Registry idea. Granted, you can edit XML with a text editor, but if every Linux distribution which used a "registry" for configuration came with command-line and GUI tools to edit it, and resonable precautions were made for redundancy and backups to protect the database integrity, who could object? After all, even "text" is really a binary file.

    What we do need is a CORBA interface, provided through GNOME (or KDE if you will), which would allow editing of configuration information without knowledge of the specific representation. Then we could use XML or some kind of binary database, and the software using the CORBA Configuration Interface wouldn't care. Software unaware of this CORBA mechanism could do it the old-fashioned way, be it text manipulation of XML files, or libxml, or whatever.

  105. Re:Wow, good idea! by YeOldeGnurd · · Score: 1
    We all know that HTML is cool.

    By association, we can assume (having never even used XML) that it is cool as well.

    By this logic, one would assume that SGML is really, really, wicked cool, being the granddaddy superset.

    Back in the day, I wrote all my term papers at The 'tute in Scribe, before TeX and LATeX came along... Scribe fizzled and is hardly remembered, but it apparently was a direct progenitor of SGML, which became the framework within which HTML and, more recently, XML were defined.

    The XML gods have done a remarkable job of finding a delicate balance between the flexibility and completeness of SGML vs. the ease of understanding HTML.

    I, for one, would love to see XML become a prominent technology. A project such as this, if it catches fire in the GNU/Linux marketplace, would be a nice proof-of-concept and could help move XML into prominence.

    Bravery, Kindness, Clarity, Honesty, Compassion, Generosity

    --
    ...Nothing interesting here. Just move along...
  106. As long there is an XSL ;_) by Fats · · Score: 1

    As long as there is an XSL to translate it back to normal format :)

  107. yuck! by cs · · Score: 1

    Look, XML is great for moving info between apps;
    nice nested tagged data, easy to parse.

    But DO NOT replace the common config files with XMLised
    goop! Many of use use plain text editors to
    control configs, or many and varied simple tools
    to batch edit them. This is very easy with the common line-oriented configs.
    Moving to XML will: (a) break every automatic script out there, (b) piss off everyone who hand edits these files.

    Plain text configs are a BIG WIN.

    Maybe for complex configs with weird nested data structures this might be an ok idea, but even then I'd
    go for something terser than XML (even the broken XML-with-short-closing-tags is too verbose).

    --
    Cameron Simpson, DoD#743 cs@cskk.id.au http://www.cskk.ezoshosting.com/cs/
  108. Glade by color+of+static · · Score: 3

    Glade does something like this. It will produce C, C++, Ada source code or an XML file describing the GTK application. With python you parse the XML and then use a build tool to build the GTK objects as they are laid out in the XML by Glade. You just have to attach the events to code that you write.

    While I see a great possibility here of having a way in which the author gives the user GUI elements and a set layout that the end user can change, the implementation suffers from the same problems that almost all XMl suffers from.

    First, very few people understand the full scope of XML and all the adjoining technologies. The only way I understand it is putting it into the same perspective as SGML, but that doesn't cover many of the other parts. I guess most of us are waiting for an O'Reilly book on it.

    Second, part of XMLs power is the way it can be used for almost anything. Part of the reason of it not being universally excepted is the the way it can be used for almost anything. Has anyone seen XML used the same way twice? From what I can see this has resulted in a lack of tools to deal with XML from beginning to end. Yes, you can merge a lot of tools to do some really amazing things, but it takes a lot of time and mental effort to come up with these chains of tools (much more so then other chains of tools).

    Third, the resource consumption for most XML based projects is high. High enough that it will limit the viable uses of XML in the short term. Building a large GUI from XML may increase the start time of memory consumption beyond where it is usable for some applications. Netscape already loads slowly, if that time were doubled I'd be looking to use lynx for most everything (half :-).

  109. Re:Possible Pitfalls of XML by ion · · Score: 1

    Agreed, for a programmer this wouldn't be an issue, but if we ever want to get some real market share from MS we have to use the K.I.S.S. ideology (Keep it Simple Stupid). Anyone can open up a text editor and read the entries of a file to some sort of tech support group, trying to read a database on the other hand wouldn't be as easy. IMHO sticking with flat files is a better bet.

  110. Re:Possible Pitfalls of XML by ion · · Score: 1

    I have no problem with the use of a database, I have some reservations, but no strong objections. Though who would create such a database? It would either have to be something built into the kernel...(doesn't really belong there). Or we may end up with a configuration databse holy war. I can see 2 seperate, but equally useful, implementations in use. Both strongly supported by deticated users. This would force App programmers to support both adding more work to their job. Truthfully besides database corruption that is the only other problem I can come up with for a configuration database, except for the inablity to edit conf file with a text editor.

  111. Re:Possible Pitfalls of XML by ion · · Score: 1

    As I said in my original post I think XML conf files are a great idea. I just wanted to mention that people are using XML for database migration and someone might try to do this with conf files, which IMHO is not a great idea.

  112. Possible Pitfalls of XML by ion · · Score: 2

    Personally I think XML would be a great way to help organize all those sometimes nasty .conf files. There is one large pitfall that needs to be avoided. XML is very easy to convert to a database system. One of the main uses it has (at least in my experience) is a great way to abstract out databases in a non-proprietary format. If XML were used with wrapper classes to access conf files some people might be tempted to port those conf files into a database and change the wrapper library to a database wrapper instead.... to a naive user (how many of these are there now?... but in 5 years?) there would be no difference. What would we end up with? A Windows like registry system. I believe this should be avoided at all costs. A database system may look nice from the outside and have lots of great features, but when something goes wrong and the settings for your favorite daemon are in a corrupt database entry what are you going to do? XML will provide the organization linux conf files need and allow the existence of the flat files everyone loves, but also presents an easy step toward database (registry) systems.

    1. Re:Possible Pitfalls of XML by ByronEllis · · Score: 1

      At the risk of making myself flame bait, I have to disagree that something like The Registry is to be avoided at all costs. Rather, I think that the registry database is, in concept, a good idea-- create a "central" (its not actually a monolithic file, as far as I there is at least one file for each top-level key) repository for systemwide configuration information with a standardized mechanism for the retrieval of information from that database. Of course, Microsoft didn't really document most of the useful information contained in the registry and the registry itself is in a proprietary binary format that would make it unsuitable, really, for Linux given you may only have vi around. However, these problems are certainly not insurmountable and an XML format would actually go a long way towards fixing those problems.

      I say go for it-- sure, I already invested the time required to learn the different formats but I'll take anything that makes my life easier :-)

    2. Re:Possible Pitfalls of XML by jovlinger · · Score: 1

      It's not too much of a strech of the imagination to visualise a library that provides 'configuration database' functionality to applications who want it, yet stores settings in xml files in the filesystem.

      This gets you the best of both worlds; those who want registry functionality, or a single graphical settings browser can use the database library, and those who prefer file hacking with vi can do that.

      The two are not exclusive.

      Johan

    3. Re:Possible Pitfalls of XML by vyesue · · Score: 1

      what are you going to do if there's a corrupt database entry?

      well, presumably, this system would be open source, and so you'd find the bug that caused the corruption and fix it.

      just because MicroSfot's implementation of something sucks doesn't mean we can't embrace and extend it.

    4. Re:Possible Pitfalls of XML by vyesue · · Score: 1

      functionality > simplicity

      you just dont get the same functionality out of a flat text file. why not write a tool that packaged up all the relevant database entries and shipped them off to your tech support provider? wouldnt such a tool be part of any complete implementation of the configuration database?

      I agree that the KISS philosophy is valid, but I think it's meant to avoid _unneccessary_ complexity. if you want to extend functionality like a configuration database would, you're bound to have to accept _some_ simplicity hit.

    5. Re:Possible Pitfalls of XML by vyesue · · Score: 1

      there's going to come a time when the Linux community is going to have to make some architectural descisions like "We're goign to support database format X for storing configuration information." if we're not willing to have these standards, theres no way to add functionality in any major way outsie of the kernel and lots of independantly developed applications.

      same with filesystems, desktop managers, etc. develop some options; pick the strongest and most flexible.

    6. Re:Possible Pitfalls of XML by JSBiff · · Score: 1

      Well, you seem to be killing the chicken before it's conceived because it might get infected with salmonella ;-) I've personally thought for almost a year now (when I first discovered XML) that it would be perfect for configuration. Think about it, as long as it is straight ASCII XML it is perfectly feasable to read it with just text editor and manipulate it any way you like; or, just as easily use GUI config applets/property sheets to manage your system, which is what a lot of people would like.

      To say that this should be avoided because 'somebody might try, 5 years down the line, to create a distro where all the apps are modified to use a binary database instead of straight XML' is kind of ridiculous. By then, presumably, if the distros standardized on this (which if it was implemented The Right Way(tm) they'd be crazy not to) then it would be futile for somebody to try to do what you are suggesting (not to mention a not-trivial amount of work). The biggest place where this kind of system would have problems would be with all the legacy code out there. . . as someone pointed out, this system would only reach its full potential after (Apache, Sendmail, whateverftpd, inetd, smbd, whateverapp) were modified to use this config system.

  113. Re:Problem with libxml by Arandir · · Score: 1

    Whoops! I double checked. libxml comes with two license files, COPYING (GPL) and COPYING.LIB (LGPL). I missed the second one, read the first, and assumed that since it said "GPL V2" is was indeed GPL V2. Nothing in the README file though.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
  114. Problem with libxml by Arandir · · Score: 2

    Although not "fully grown", libxml will do what you want it to do. However, it has one major drawback: it is a GPL, not a LGPL library. This means that only other GPL programs can make use of it. Since libxml is part of the Gnome libraries, this is normally not a problem as all Gnome applications must be GPL (hmmm, are LGPL libraries allowed link to GPL libraries?). However, the question was wondering about broad XML support, and thus libxml won't work for other licenses such as BSD, Artistic or MPL (a lot of XML utilities are licensed under MPL).

    However, there are two other C/C++ alternatives. The first is expat which is a C library that's pretty extension with extremely liberal licensing. The second is still beta, it's a new feature in the Qt 2.1 snapshot. The KOffice project is using this. There are, of course, dozens of Java and Perl XML libraries as well.

    I don't think that you will ever see one single XML library for all purposes, but there are enough XML libraries available now in a range of Free licensing and languages that it won't be a problem.

    --
    A Government Is a Body of People, Usually Notably Ungoverned
    1. Re:Problem with libxml by Zurk · · Score: 1

      libxml is LGPLed. See freshmeat.

  115. Putting angle brackets in posts (offtopic) by Mike+A. · · Score: 1

    What you do to put tags into a Slashdot post is you escape the angle brackets. For example, instead of putting , put <. And, of course, represent & signs as &.

    --

    --
    Do I look like I speak for my employer?
    1. Re:Putting angle brackets in posts (offtopic) by Mike+A. · · Score: 1

      Except that preview does strange things to that. Oh dear. To repeat what I said without previewing, use < instead of <.

      --

      --
      Do I look like I speak for my employer?
  116. Erm... problems reading? by listen · · Score: 1

    See here. Duh. Its LGPL.
    LGPL libraries can link to a GPL library, but then they will be GPL'ed. Unless there is a source and binary compatible implementation of the lib in non GPLed form - for this you could make a stub, pretend its work in progress, and still use the GPL'ed library in reality if you don't feel like abiding by the spirit of the GPL. This is a bit evil though.

  117. A point I haven't seen raised... by Cowards+Anonymous · · Score: 1
    ...is that config files (with the exception of sendmail.cf) are supposed to be human-readable.

    It is not very reasonable to define XML as something human-readable. A human is forced to read the fairly-cryptic DTD, and then apply that knowledge towards the structure of a document.

    I find it much easier to say something like: echo "nameserver 192.168.1.1" > /etc/resolv.conf than to spew several lines of XML header followed by the arbitrary, possibly multiline contents of a tag or nested set of tags.

    Simplicity in reading, writing, manipulating and parsing are all positive attributes in a configuration file format, and XML fits few or none of those critera, as far as I understand. In a pinch, I can use very simple tools (such as those built into ash or found on a rescue floppy) to fix a configuration problem, whereas with XML, a layer of complexity is added to that task which is extraordinarily unnecessary and possibly irksome under the circumstances.

    1. Re:A point I haven't seen raised... by fornix · · Score: 1
      I find it much easier to say something like: echo "nameserver 192.168.1.1" > /etc/resolv.conf than to spew several lines of XML header followed by the arbitrary, possibly multiline contents of a tag or nested set of tags.

      It wouldn't be much harder to type something like:

      xset network.resolv.nameserver 192.168.1.1
      The xset program would replace your echo command, and intellegently parse the DTD's and make sure that you are making a valid change. With the proper system tools created or modified to use xml, you really won't have to go through much more trouble, and you gain the ability to do validation or use GUI tools easily. If you want to edit the xml with vi you could do that too. And emacs....I'm sure there's a way to get it to work gracefully with xml config files (it does everything else already!).
  118. Please! by Megaweapon · · Score: 1

    I've been dreaming of this for a while. Just think, all the config files are still text, but you have the option to configure anything using a generic curses or X-based program. Or you can still use good-old (insert your favorite text editor here).

    --
    I'm sure "SlashdotMedia" will improve on all the wonders that Dice Holdings blessed us all with
  119. Why a standard DTD by EthanW · · Score: 3
    A lot of commenters have stated a need for a common xml configuration dtd, to prevent the proliferation of dtds. I don't necessarily agree with this need.

    A common dtd is good if you want to exchange the xml data that it describes among different applications. In the case of a document or spreadsheet, this is clearly a good thing. However, I don't see people developing a pressing need to exchange their configuration files between different applications. What other application could possibly have a use for a sendmail configuration other than sendmail?

    If each application has its own configuration dtd, then editors can use that dtd to help the user write a valid config file. It can specify required tags, optional tags, and describe the structure of the file. Rather than using generic tags like <item id="username">Ethan</item> you can have <username>Ethan</username>, and this way the dtd can require the username tag, so you don't forget it. A common configuration dtd would be far too generic to be of much use in this.

  120. Already Done by msslave · · Score: 1

    Consider this already done.

    Check out Allaires contribution to XML: WDDX

  121. Linuxconf? by delmoi · · Score: 1

    isn't that what linuxconf is?
    "Subtle mind control? Why do all these HTML buttons say 'Submit' ?"

    --

    ReadThe ReflectionEngine, a cyberpunk style n
  122. Re:XML.. by Scotter · · Score: 1
    I agree that a phased approach will be of great benefit-- especially to Linux package distributors.

    The place to start is linuxconf-- it's already trying to be a central warehouse for modifying configuration files. It would be a great testbed for the DND's used for various system configuration files. It's already got lots of code to bidirectionally parse many config files.

    Having small modules to filter the XML's into the appropriate config files is a small price to pay for a robust development strategy. (Don't touch the application until the new form is proved to work.)

  123. Just do it. by SEWilco · · Score: 2
    OK, pick an application and convert it to use an XML configuration file. Make an XML configuration program for it. See if the owner accepts your patch. Then try another application.

    I don't happen to be working with such an application at the moment, but I am enhancing some Linux documentation with XML-type labels. Not that it will be directly visible, as it will only be used in producing other documentation. But you can just pick a corner you like and start painting.

  124. Good Idea by fornix · · Score: 1
    XML will work nicely for config files. I would like to use it for:
    • httpd.conf
    • LDAP
    • conf.modules
    • sendmail.cf
    • cron.*
    • host.*
    • GNOME/Enlightenment
    • Browser config (coming in Mozilla?)
  125. Well, darn by DonkPunch · · Score: 1

    and there I was getting all excited about starting a cool project -- fame, fortune, free coffee mugs.... :)

    Thanks for the tip.

    --

    Save the whales. Feed the hungry. Free the mallocs.
  126. XML and config files by DonkPunch · · Score: 5

    XML in place of the current config files would have some advantages. For one thing, it would allow use of a single high-performance parser to parse the files. The days of writing/copying a config file parser for every application would be over. Perhaps we could create a shared library to do this. (If there is any interest in a libxml.so, please let me know. It sounds like a cool project.)

    It might reduce version control issues in some cases since new/unknown tags in XML can be ignored (much like unknown HTML tags are ignored). However, a well-written config file parser would do this already.

    It would probably speed up the process of creating GUI front-end configurators, since the parser/generators could be reused. An advanced user without a GUI configurator is like a fish without a bicycle, but it would be helpful to newbies and regular desktop users. The "Linux is hard to use" argument would start to go away.

    There are some big drawbacks, though. The first is that tons of applications would have to be revised in order to read XML config files. In an open-source world, this means a long painful process where some developers switch to XML immediately and others wait a while. Then there is the pain of converting your customized http.conf/fstab/.profile/etc (bad geek pun intentional) files to XML.

    Also, there is the fact that most of the cool tools in Linux are really designed for all of the Unix world. Realistically, the Linux environment can't just switch over to XML config files unless the entire Unix community does.

    Maybe future apps should use XML as their config file format. I don't see our well-worn existing tools making a switch anytime soon, however.

    Just my 2 cents.

    --

    Save the whales. Feed the hungry. Free the mallocs.
  127. Text is a feature by ~k.lee · · Score: 1
    However, binary files may have an arguable advantage - space and speed.

    Space and speed are cheap, especially given the negligible cycles required to parse config files.

    Part of the Unix philosophy is that the pervasiveness of text is considered a feature, not a bug. Text is a good interface for many reasons. Three of the most important ones are:
    1. It is easy for a human who knows what (s)he is doing to hand-edit text. This becomes very important in cases like config file corruption or broken configuration tools.
    2. Text editors are well-understood and mature, and almost never broken: emacs, vi, etc.
    3. Most existing Unix tools are very good at working with text, making it easy to write scripts to automatically process anything made of text.
    I don't know why everyone is so opposed to copying the Windows Registry idea. Granted, you can edit XML with a text editor, but if every Linux distribution which used a "registry" or configuration came with command-line and GUI tools to edit it, and reasonable precautions were made for redundancy and backups to protect the database integrity, who could object?

    Q: What is the purpose of a registry?

    A: To provide a unified heirarchical view of configuration data and an API for accessing that data.

    A heirarchical view of configuration data is provided by the Linux filesystem. An API for accessing that data is provided by stdlib.c.

    Adding a binary database gives us exactly zero advantages over merely (a) standardizing the configuration file heirarchy under /etc and (b) using XML in selected cases to represent complex structured and semi-structured data.

    Registries in and of themselves are not a bad idea. However, we don't need an opaque binary file coupled with a superfluous API in order to have a registry: we can implement one just fine using only the existing filesystem, text, and existing libraries. It would have all the features that you outline above.

    ~k.lee
    --
    (remove nospam for email)
  128. duh. no way. by Zurk · · Score: 1

    What i'd like to see is a standard way to read/write too/from XML files using a standard C library type function call. Right now most C programs (and face it those are the majority) have a standard fopen(), fget(), fput() calls which make the database format fairly standard - ascii text in various forms. I'd like to see the equivalent in XML so read/writes can occur from XML files (no , i dont want to parse it manually in my C prog..thank you very much)...something like an add on to the standard C/Java/C++/Fortran libraries will be very nice. and it should be GPLed.

  129. Editing configuration files by ebcdic · · Score: 1
    Another advantage of using XML + (DTDs or schemas) is that XML editors will provide structured editing "for free". How many times have you run vipw only to get a complaint about a syntax error at line 137? An editor (or an emacs mode) that only allows you to enter valid XML will catch many of these errors as you type them. Or to look at it another way, you can automatically derive a form-style interface from a DTD or schema.

    So rather than it being "another thing to learn" it can provide a simpler user interface.

  130. A few observations by ebcdic · · Score: 2
    I think that XML provides an obvious first-choice syntax for anyone defining new files structures, and unix (not just Linux) configuration files are a good example. Here are a few thoughts I've had on the subject:
    • It must be simple for applications to read the data into directly useful structures - when you read the password file you want to get a pointer to a struct passwd rather than an element whose children and attributes you have to examine. XML Schemas should help with this (and it will be schemas rather than DTDs).
    • There's a small annoyance concerning control characters. Despite XML having a syntax for numeric character references, these can only refer to legal XML characters, which means not control characters (so you won't be able to use &#33; for escape in termcap.xml). The library will need to provide a mechanism on top of plain XML parsing to handle this.
    • It should be possible to make the change invisibly to many programs (getpwent will just read the XML syntax into the same old structures) but it will still be necessary to provide conversion tools.
    • Validation (probably schema-validation) will provide a handy way to (at least partially) check files before installing them.
  131. Why reinvent the wheel? by CoughDropAddict · · Score: 1

    Microsoft has already discovered a solution that will make those silly text configuration files completely unneccesary:

    Let's give it up for the Registry!

  132. Why XML? Cuz comments are the most important data. by FuzzBucket · · Score: 1

    The best thing about UNIX config files is that they are self-documenting -- the good ones contain comments that allow users with a basic proficiency to figure out how to configure stuff easily. The history and purpose of changes can be conveniently embedded. Putting aside its fragility, Windows' registry is broken because it is simply incomprehensible. Even sendmail.cf gives some guidance about what stuff means in the UNIX world.

    But most UNIX config files are broken in that comments don't have a well defined place in the config file syntax -- they are just ignored by parsers. This is BAD. If config files are edited both by users and by automatic tools that parse and regenerate, all of this infomation and history can be lost. It is hard to code around this -- even if you preserve the comments, their meanings are location dependent and getting the location right in the face of changes can be nearly impossible.

    The biggest win about XML is that instead of defining a comment syntax that parsers ignore, we could define a standard <config:comment> element which would maintain a well defined place in the structure of the files. Hackers could edit plaintext and comment, tools could edit and regenerate (and comment), and all the documentation would be well preseved. [Parser-ignored <!-- ... --> comments would not be used.]

    This is a perfection, not a departure from the UNIX philosophy -- information in simple, human readable, machine manipulable ASCII files. We just need to take care that our DTDs are easy for humans to read, understand, and edit.

  133. Go for it - but keep communicating by Simon+Brooke · · Score: 5
    XML is a technology with a lot of potential. Many if not most of the Open Source applications which people will use for Linux are going to end up using XML. Consequently if there are standardised libraries for parsing XML in different languages, and standardised places to keep DTDs (/usr/local/lib/sgml is probably common), this is going to be a big win.

    But the biggest win will come from minimising the proliferation of DTDs. If the community can co-operate on the development of common DTDs then the exchange of data between software agents developed by different projects will be hugely easier. By all means have diffrent projects - both KDE and Gnome have, in my opinion, benefited from the competition between the two - but if that competition develops the sort of bitterness which reduces communiction and co-operation we all lose.

    I would strongly urge anyone who is developing a new software agent - whether it's a user-level application or a new daemon - which either stores data or exchanges data with other agents to seriously consider XML as a format, but more importantly should look at the DTDs that already exist to see if any will fit, and should communicate with anyone else working on related tools.

    If anyone wants to look at the XML tutorial I gave at INET99 it's here

    --
    I'm old enough to remember when discussions on Slashdot were well informed.
  134. ASCII, not XML by drivers · · Score: 1

    the use of simple, separate, config files is that they can be moved, edited, built using simple sh, grep, awk, cat, vi, etc. commands.

  135. XML is a Great Thing by Hard_Code · · Score: 1

    XML is great. Although there are some places in which it doesn't fit in, it is as much a panacea as anything could be. XML basically is just a standard plaintext way of describing everything. RDF can basically describe any resource. AllianceOS is also looking at XML as a way of storing system configuration. XML is being used already as an application revision synchronization mechanism. It's being used for those little Slashboxes. I don't want to sound like a zealot, but I think XML is /the/ way to go. It can only help. Imagine standard installation routines specified by XML...XML system configurations and package formats...the list goes on.

    XML IS overkill in some cases...some things are just so darn obvious tags would just get in the way...but I think at higher, broader level, XML can help very much.

    --

    It's 10 PM. Do you know if you're un-American?
  136. XML helps you see matching pairs by bharlan · · Score: 1

    I agree that XML datastructures could be filtered by a perl script into an equivalent LISP structures. In XML, however, you can see the equivalent of the closing parenthesis with your naked eye, without a browser designed specifically for LISP. Tcl is another dialect of LISP, but with brackets and braces and newlines to break the monotony.

    --
    (Reality reasserts itself sooner or later.)
    1. Re:XML helps you see matching pairs by bharlan · · Score: 1

      No I personally would use emacs with color highlighting. But sometimes, cat/more/less is enough. To look at deep nesting delimited by parentheses, you must trust the indentation scheme, or test every pair yourself. A closing XML tag is always immediately obvious. Readability often requires extra keystrokes. For example you can name a variable "tableRowIndex", which is tedious to type, or you can name it "i1", which is tedious to read.

      --
      (Reality reasserts itself sooner or later.)
    2. Re:XML helps you see matching pairs by bharlan · · Score: 1

      I may have missed your point. You mean that XML should be looked at with tools that graphically display the hierarchy. I agree. But sometimes you'll need to look at the file as well. Would you build a web page without ever looking at the HTML? I hope not. And I would never design and use an XML data structure without looking, sooner or later, at the raw ascii file. The XML format makes this as readable as possible. Otherwise, why bother to make it ASCII in the first place?
      I personally love LISP. Programs have exactly the same format as data. You can't say that about dialects like Tcl. But the big drawback for LISP data structures is that they are hard to parse with the naked eye. If you only look at your data structures with interpretive graphical tools, then who cares what the persistent file looks like?

      --
      (Reality reasserts itself sooner or later.)
  137. Wow, good idea! by [Dilbert] · · Score: 0
    I don't know XML.

    I'm aware that it is (in a way) a superset of HTML.

    We all know that HTML is cool.

    By association, we can assume (having never even used XML) that it is cool as well.

    Linux really could use a standard config system, and this is a proposal that sounds as though it really has some merit. Hopefully some guy at RedHat or Debian or Slack or YellowDog or TurboLinux or... (being distro agnostic here...)

    hopefully one of the distros picks up on it.

    It'd be cool. Truly Cool (tm).

    --
    From a motherboard manual, error beep codes: S-L-L-L-SS: Speaker Error
  138. Shameless Plug, but Interesting you should ask by Mr.+Blonde · · Score: 2

    I've established a project to produce a lightweight structure document management system using XML. Essentially it is an XML DBMS. The project is still very very young, but is growing rather quickly.

    http://www.dbxml.org

  139. Re:great -- doxygen by HarpMan · · Score: 1

    "one of the reason why you don't find so much tools like javadoc for c++)" --

    Doxygen, Doc++ and KDoc are all variations of Javadoc for C++.

    --
    Stephen Molitor steve_molitor@yahoo.com
  140. Bye-bye grep and text tools by Tom+Christiansen · · Score: 3

    The more you stray from line-based text files that you can easily call things like awk and grep on, the more you'll alienate some people. I don't believe there's a version of awk or grep that handle XML-based records. This is pretty important to tool-minded people.

  141. Same Thought..What about OSS ODBMS? by Flak · · Score: 1

    You can buy one, but is there a OSS ODBMS out there? XML really needs a good Object Database to make sense. Why worry about DTD's until the storage schema is developed. God I just got an idea, I need to go code...

    1. Re:Same Thought..What about OSS ODBMS? by sjt · · Score: 1

      There is Ozone, an OSS OODBMS which is having XML access added to it in the form of a persistent DOM (i.e., a persistent, tree-structured view of the XML). Checkout http://www.softwarebuero.de/.

  142. Why not SGML? by sgml4kids · · Score: 1

    It seems to me that using XML for general-purpose
    config files is extreme overkill (would every
    application need to submit a DTD?). Maybe for a general-purpose registry (like KDE is doing) it makes sense; one DTD for all apps. But I don't think we can expect a large number of applications to use such a complicated format as XML for config files.

    On the other hand, a robust SGML library that can let applications manipulate DTDs and documents would be amazing! Linux would blow all
    other contenders away if it provided a full suite of SGML editors, publishers and architecture tools.

    I'm also curious why everyone is focussing so much on XML. Wouldn't SGML be a more powerful solution?

    1. Re:Why not SGML? by sgml4kids · · Score: 1

      What's most disappointing about XML is the
      SUBDOC restriction. For a lot of industrial
      applications, this is an essential feature.
      It's used, for example, in the linuxdoc DTD.

      Is that a formal feature of XML (parsing without
      a DTD)? There are many tools that attempt to
      parse SGML documents (and deduce the logical
      structure), but in many cases, they are just
      taking educated guesses. What feature of XML
      makes this possible?

  143. Re:XML and configuration systems... by Chalst · · Score: 1

    Let me make my point another way: if one uses S-exps, then one finds oneself looking at an awful lot of nested brackets. With XML, one sees that s match s, etc.

    The second point about typing is that, whilst one may easily test whether an S-expression is well-formed, one doesn't need to. In my view, a volutary type discipline such as LISP/Scheme uses is less than half a type discipline.

    Lastly, about ease of use: there can be no doubt that using S-exps with LISP/Scheme is very natural: all of these wonderful tools such as quasiquotation. Also very natural to use in a UNIX setting with scsh or guile. But this is a `one size fits all' argument: tools exist in other languages for XML, but they don't for S-exp. I think XML has the edge on XML for ease of reading, but I understand that may be debated; still I think the point about language support trumps the issue.

    And I am not getting at Scheme/LISP: scsh is one of my favourite languages...

  144. Re:XML.. by Chalst · · Score: 2

    It should be possible to write a set of filters to convert between XML and standard configuartion files. Whilst this a lot of work to begin with (ie. such a filter for each different kind of configuration file, which is pretty much one for each different configuration file, if it was possible to begin with a biggie) such as the .xinitrc file, that might create the momentum to convert over the other applications. Writing filters of course obviates the need for the application writers themselves to rework existing code, which may be pretty much impossible with something like X windows.

    Of course people have been saying config files should be LISP S-expresions for years; maybe the hype about XML will be enough to make this idea work...

  145. Re:XML and configuration systems... by Chalst · · Score: 2

    Actually XML is a bit more general than S-exps in that it allows you to pass parameters, and specify that these parameters are optional, fixed, or have default values. Of course these can be simulated in LISP, but the ways XML handles them is cleaner.

    Also XML has something resembling a type system in its DTDs, which seems somehwat alien to the LISP mindset...

  146. LDAP and Windows Registry by el_ted · · Score: 1

    What about using LDAP together with XML or other text/script configurations to build a single configuration framework for linux, just like the windows registry?

    --
    -- You are in a twisty maze of passages, all alike.
  147. Re:XML.. by TurkishGeek · · Score: 2

    Thanks, I have written a couple of XML apps myself, and know it is text based. The distinction between what I refer to as "ASCII config file" and XML config file should be fairly obvious.

    People creating DTDs on their own is not the whole point of XML. People using standardized DTDs that are widely accepted by the target community is. If you see half a dozen different DTDs for Linux app. configuration files, all supported by various(different) development groups, there will be added confusion to Linux maintenance and installation; which is already being used as FUD material by Microsoft and the gang. That will not be good.

    The bottom line is: With XML, you're not supposed to "create DTDs for whatever task is at hand", if your application is intended to interoperate with those of other vendors, companies, etc. Industry groups already started to take the liberty of creating DTDs on their own with the hope that their DTD may turn out to be the de facto standard in the field; and that will cause major fragmentation in the near future. It is already happening in the e-commerce area with different DTDs being pushed by Microsoft's BizLink and Rosetta, etc.

    --
    Zigbee Central: A Zigbee weblog
  148. XML.. by TurkishGeek · · Score: 4

    While I agree this can definitely be another good way to use XML; I'm not sure everyone will be willing to abandon the ASCII config file formats they have been using for a very long time, and move to an XML-based configuration registry. But something like this has to be done sooner or later.

    People are moving and creating DTDs on their own which has the potential to cause a huge fragmentation on the XML arena; so before someone tries to design a configuration DTD, there must be some concerted effort to start a group within the Linux community that will work on this and other relevant XML DTDs.

    Just my 2 cents.

    --
    Zigbee Central: A Zigbee weblog
  149. Re:XML and configuration systems... by bingster · · Score: 1

    On the whole I agree with the Anonymous Coward about the basic equivalence of XML and S-expressions. However, I think that XML has four important things going for it: * The existence of DTDs provides a standard way to declaratively specify a schema as well as well-formed representations of that schema * The existence of XSLs provides a nice standard declarative way to seperate data structure from data format. * The momentum and hype associated with XML helps to assure the acceptance of an XML approach as well as the existence and longevity of tools, browsers, etc. -Mark

  150. Open Source XML Editors by hedgehog_uk · · Score: 1

    Any plain text editor can be used to edit XML files, but a structured editor helps enormously. I have tried out quite a number of (free and commercial) structured XML editors on Unix and Windoze and my favourite so far is the XML mode for Emacs, which is based on the excellent PSGML package. And it's open source and I don't have to leave my favourite development environment. Does anyone know of any other open-source XML editors?

    Cheers

    HH

    --
    Yellow tigers crouched in jungles in her dark eyes.
    She's just dressing, goodbye windows, tired starlings.
  151. XML is ASCII by hedgehog_uk · · Score: 1
    the use of simple, separate, config files is that they can be moved, edited, built using simple sh, grep, awk, cat, vi, etc. commands

    Since XML is plain ASCII, just like HTML, standard ASCII editing tools and scripting languages can be used to build and edit XML files. XML is also easily human-readable, sometimes more so that standard *nix config files.

    HH

    --
    Yellow tigers crouched in jungles in her dark eyes.
    She's just dressing, goodbye windows, tired starlings.
  152. Re:XML Everywhere (soon) by hedgehog_uk · · Score: 1
    Thanks for all the information, but it still doesn't explain: what does XML DO?

    It's not a traditional programming/scripting language like C, Java, Javascript or Perl. It's a meta-language for defining markup languages such as HTML or SMIL. You would use it for creating structures of tags to mark up data. These would look very similar to HTML markup tags, the difference being that HTML gives you a fixed set of tags (e.g. <P>, <head> etc.) whereas XML allows you to define your own.

    The tags are defined in a Document Type Definition (DTD) which looks complex, but isn't that hard to write. This gives you an enormous amount of flexibility in what you use XML for. If you defined a slashdotter DTD as:

    <!ELEMENT slashdotter (name, email)&gt
    <!ELEMENT name CDATA>
    <!ELEMENT email CDATA>

    You could then write the following XML:

    <slashdotter>
    <name>A Coward</name&gt
    <email>a.coward@slashdot.org</email&gt
    </slashdotter>

    This could then be displayed in a web-browser using a style-sheet, read into a database, used to send spam etc. DTDs can be defined for configuration files, spreadsheets, word-processor documents, or almost any data, which makes XML enormously flexible.

    Hope this helps a bit

    HH

    --
    Yellow tigers crouched in jungles in her dark eyes.
    She's just dressing, goodbye windows, tired starlings.
  153. XML Everywhere (soon) by hedgehog_uk · · Score: 4
    For those who don't know much about XML, it's a markup language similar to HTML. In fact, it's not really a super version of HTML, but a subset of SGML. XML is a meta-language used for creating other markup languages such as the multimedia language SMIL (Synchronized Multimedia Integration Language). XML is useful for storing data independently of it's presentation. In HTML, the presentation tags are mixed up with the content. XML allows you to separate the two and use stylesheets (possibly written in XSL, its stylesheet language) to format the data for display.

    I started out using XML for simple configuration files on a Java software project. Once we started to use it, we realised that it's extremely powerful and soon started finding many uses for it.

    Expect to see XML cropping up everywhere soon. Microsoft (boo, hiss) is going to be using it for document exchange (XML is very good at this) in their Office products. There are rumours that M$ is already bastardising XML, rather than stick to the standards (now where have we heard that before?).

    XML initially looks daunting, but really isn't too difficult to learn. There are some standard API's being developed (SAX and DOM), at least in Java. XML and Java work very well together. I haven't used XML with Linux, so can't comment on available libraries, if indeed there are any yet.

    I certainly would encourage developers to look into using XML. It certainly beats writing your own parsers and you'll soon appreciate its flexibility. HH

    --
    Yellow tigers crouched in jungles in her dark eyes.
    She's just dressing, goodbye windows, tired starlings.
  154. Flavour of the month by Lew+Pitcher · · Score: 2

    I'm sure that there are a multitude of uses that XML can be put to on a GNU/Linux system. However, I don't think that XML is the panacea it's touted to be. Like Java before it, and C++ before that, and C before that, and Pascal before that, and Basic before that, XML is just another tool that's been the target of a lot of hype.

    Certainly, you could implement a 'registry' in XML. The question is not "can you", but "what benefit does it provide and what are the drawbacks". The question of a "Windows registry" for Linux has often been discussed in the newsgroups and the usual response is: "What happens if your registry gets corrupted?".

    By all means, develop an XML 'registry' tool, and/or enhance X to include XML attributes, and/or develop a new filesystem that uses XML as it's structure, but please don't expect that your development is going to replace the existing tools and features of the system. Like the ever growing variety of scripting languages, the only thing your development will accomplish is to add another choice to the mix.

    Good Luck.

    --

    "values of beta will give rise to dom!"

  155. some things i thought. by V-1138 · · Score: 1

    I have heard/participated in many a similiar conversation and have a couple of thoughts --

    1) I see the real added value of XML config files as this. Ease of configuration through applications (scripted or some GUI or whatever). The great thing about XML documents is that they can be self describing. Markups like: could easily be used to create "on the fly" interfaces to modify any file. If created wisely, a DTD could provide enough generic ability to accomodate most any resource file (why not X resources too?). Then, it would be trivial (compared to establishing a DTD) to create UIs that need not care about the data, just the fields.
    3) And another thing, why not use it to describe hardware and devices.
    4) How about users and profiles?
    5) I could rave forever...

    The point is -- using XML has little impact on the actual data but would provide a common and pleasant way to interface with the data (ie: manipulate, read, interpret (you could have comment fields, hyperlinks to help files)) -- none of this is out of the scope of XML. It just needs some agreed upon standards and a few champions. Arent Mozilla config files already stored in XML? and are Slash's config files not also in XML(ish)?

    remember: "Good ideas go to waste on those who already know the solution" -- versil

    ps: Many posters are pointing out unwillingness to learn new things or to change from old ways on the part of developers. Tough. This is how the future moves.

  156. something else i thought. by V-1138 · · Score: 1

    Imagine if you were to convert everything in /etc to XML. think of all the apps that already know how to read those files -- they would have to be rewritten to know how to extract useful info from XML (eg: bind, login, the inetd). A very daunting task indeed. Still, I am not opposed to the idea. I see a whole new system emerging based on the linux kernel...

  157. Appropriate uses of XML by Evil+Pete · · Score: 1

    XML is probably best applied where there is some variable structure data in some kind of nested format. For an excellent example of this just look at the un gzipped spreadsheet files from gnumeric which are XML. However, configuration data often doesn't require quite such a level of nesting and although XML solves object oriented data etc very neatly it seems overkill for configuration issues. A lot of configuration data is quite happy with the old "keyword=value" format.

    If we ever wanted to implement a Registry for Linux (shudder!) then XML would be a good way, though why you'd want to do it is another matter :) .

    As a data interchange format it seems to me ideal, as long as the tags are understood at both ends ... but that's going to an issue anyway no matter what the format.

    --
    Bitter and proud of it.
  158. Pluggable Configuration Modules? by vyesue · · Score: 1

    I've been thinking about this for a while. different users want to configure their machines via different types of mechanisms: windows lusers like their gui tools, old school unix crustys like to use vi and remember cryptic syntax in a million different formats, sysadmins would like somethign that can be managed locally and rolled out across the network easily...

    would it be a Good Idea to make something akin to the Pluggable Authentication Module? people could adapt existing applications to use a Pluggable Configuration Module of their choice; the PCM lib would then translate whatever configuration type of configuration information that existed into a generalized format and then feed it to the application. the app would only have to be rewritten enough to translate the generic generalized command format into the information that it needed, and then any type of configuration format is just a module away.

  159. Re:XML and configuration systems... by Gannet · · Score: 1

    > ... and refactoring configuration information among dozens of software projects that aren't even necessarily aware of each other would be an interesting problem in change management.

    Heh. Droll, very droll. :)

  160. XML to create code-frames by 50bmg · · Score: 1

    Every serious code writer needs to look at GSLgen from http://www.imatix.com , a freeware XML parser and code generation engine. The idea is to have code write the bulk of code. Machine generated code is more precise, more easily maintained, and becuase you control the generator, you don't sacrifice control. Config files as XML is a step in that direction.

  161. Using XML for Object Persistence by common · · Score: 1
    There is a good article on xml.com talking about the use of xml for object persistence. Configuration files were not its intent, but it also gives a broader perspective.

    See the following: http://www.xml.com/pub/1999/09/serialization/index .html

  162. XML, phooey. by gblues · · Score: 1

    Those who forget Amiga's IFF format are doomed to re-implement it, poorly.

  163. Re:XMLTP by gavinroy · · Score: 1

    I don't quite see the one to one comparison. I wouldn't call this reinventing as well, since XMLTP has been in existance for at least a year and a half. Gavin

  164. XMLTP by gavinroy · · Score: 2

    I am working on an Open Source project called XMLTP. XMLTP seeks to standardize the transport mechanism for XML data. By taking cues from the Linux and Apache community, XMLTP.org is in the process of developing a standard way to send, receive, and execute upon XML data. By creating a common pathway, in the form of a client and server, a protocol, programming API's, and standard for formatting, XMLTP.org will provide a core technology to make XML more than just a web-based data formatting standard. For more information http://www.xmltp.org

  165. LinuXML Project by skb · · Score: 3

    The LinuXML Project is "devoted to changing the UNIX de facto standard for inter-process communication (IPC) and storage from line-based ASCII records to XML."

    --

    Check out the

  166. grep for XML-based records by skb · · Score: 3

    There is indeed a version of grep for XML-based records. It's called sgrep (structured grep) and "is a tool for searching and indexing text, SGML, XML and HTML files and filtering text streams using structural criteria." It is based on the concept of regions, i.e. nonempty text substrings that are typically occurrences of constant stsrings, SGML tags, or meaningful text elements recognizable via delimiting strings or the built-in SGML, XML and SGML parser.

    --

    Check out the

  167. I spoke on this at the 2nd perl conference... by tbray · · Score: 2

    ... back when we were doing the initial work on wiring XML into perl. I managed to get hysterical storms of laughter out of the audience by flashing up 5 or 6 well-known *nix config files in increasingly ugly and baroque syntax. I forget the details now, but there was inetd.conf and fstab and httpd.conf and so on; all of which have multiple chunks of data encoded in text with a totally arcane ad-hoc set of syntax rules for fishing them out.

    XML probably wouldn't actually be as easy to read as inetd.conf or fstab for someone who's used to inetd.conf or fstab, but there are those times when you pull up a conf file that's new to you and wonder what the author was smoking. Lesson - great programmers often design hideous config syntaxes.

    The one that totally brought the perl conference house down was fvwm95rc.whatever.m4, I forget the exact name, which has an absolutely hair-raising melange of positional, functional, and from-another-planet syntaxes (and then had to be run through m4 fergosshakes. (why does m4 still exist?)

    Anyhow, I think history has shown that a set of textual config files is a better way to run an OS than a set of dialogue boxes or a hierarchical binary 'registry', so it would be kinda nice if there was some common syntax out there. But even speaking as a certified XML bigot, it's hard to see how to get there from here. If I can help, let me know.

    Cheers, Tim Bray (tbray@textuality.com)