The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

what's the purpose of XML?

in software design, what can xml do ?
Sunday, June 25, 2006
Describe and store data in a hierarchical fashion. Act as a data exchange format...
John Topley Send private email
Monday, June 26, 2006
Hide simplicity in massive complexity so no one else can understand what you have done.
Lionell K. Griffith Send private email
Monday, June 26, 2006
The quick and blunt version is that it's just a standard way of "marking up" text, i.e. if you wanted to represent startup information for your application in a config file, you could use something like:

c:\progs\myapp :: startup_directory
11 :: max_users
UK_English :: locale
nasty_green :: colour_scheme
oblong :: button_shape

and your app could happily parse this into the information it needs. The problem then comes when another app needs to use the information; the new app needs to know that the first part is the data, the "::" is the separator and the rightmost part is the tag / label. XML is a defined standard that means that anything else can parse your data, although it might not be able to do anything useful with it, e.g.

<table height="2" width="3" shape="square" style="coffee" />

might define a table in a document three columns wide and two rows high in a colour scheme called "coffee", or be instructions to a manufacturing system to make a square coffee table two feet high and three feet wide.

This problem is addressed by "namespaces" and, if you only understand one concept in XML, make it that one, because without it you will struggle.

For more details, try places like or even (although they don't exactly make their documents easy to use)
Paul Brown Send private email
Monday, June 26, 2006
Provide a more verbose and bloated way to store data. :)
NPR Send private email
Monday, June 26, 2006
You need to start by looking at

Discussing the apparent similarity of Lisp S-expressions with XML syntax Eric Naggum wrote

"They are not identical.  The aspects you are willing to ignore are more important than the aspects you are willing to accept.  Robbery is not just another way of making a living, rape is not just another way of satisfying basic human needs, torture is not just another way of interrogation.  And XML is not just another way of writing S-exps.  There are some things in life that you do not do if you want to be a moral being and feel proud of what you have accomplished."

The rest of his rant, one of my favourites on the net, is at
Will Dowling Send private email
Monday, June 26, 2006
Great quote from the rant:

"In many ways, the current American presidency and XML have much in common.  Both have clear lineages back to very intelligent people. Both demonstrate what happens when you give retards the tools of the intelligent. "
Ronan Keating
Monday, June 26, 2006
the reason that i ask is because there is a application that we use but it doesn't do some of stuff that we want to do but since the application saved the data into xml files so if we need to fix or do something that the application doesn't do. we can simply manipulate the data in xml files but it seem to me that a database like MS SQL or Mysql should be better suited for the job (storing data) or am i missing something?
Monday, June 26, 2006
I depends on exactly what you are trying to do with the data. If it's simply storing transactional data, then it's probably better to be in a database. But if it's exporting data that might need to be imported and manipulated by one or more other applications in batch process, then XML might be a better way to go since it makes it easier to have loose coupling between the applications.

And in response to the XML nay-sayers, like any tool, XML has it's uses. There are places where it makes a lot of sense to use XML and places where it make no sense, telling the difference can be the tricky part.
Dan Boris Send private email
Monday, June 26, 2006
XML is a self-describing, self-delimited language for hierarchical documents.

Self-describing allows any programming language to process xml documents and it makes xml ideal for dataflow type of processors.

Self-delimiting enables it to work over an unreliable communication infrastructure (aka Internet) since document integrity is verifiable.

As an interesting feature, xml can be used also as a DDL (XSDs) or as a programming language (XSLT). Why interesting? Because using the same syntax, you can pass data, data semantics (as schemas) and data transformations (xslt templates) to a processor. Basically the language can pass all of the data, the meaning of the data and data transformation using the same protocols. This recursive behavior is quite remarcable and it is all derived from the self-description property of the language.
Dino Send private email
Monday, June 26, 2006
in addition to xml's hierarchical fashion. the fact that there are so many parsers out there makes your job easier.
Tom Vu
Monday, June 26, 2006
but how can you make your xml file secure? anyone can open any xml file with a text editor and you can read the whole strucute of data.
Tuesday, June 27, 2006
Yes that's true, but without a schema you just have a text document with tags.  Without the schema you can't tell what the overall structure of the document is, or what data can or cannot be used in a particular tag.  If you hide the schema in some way.  You make it very difficult for anyone to glean any information from the file.  Sure, they could make guesses, but they are just guesses.
Gareth Lewis
Tuesday, June 27, 2006
You can make your XML data secure the same way you'd make any other data secure.  Restrict access and/or make access difficult.  For instance, require that it only be exchanged over secure channels or encrypt the data.  There's nothing inherent in XML to support encryption, but the openssl library provides an excellent set of tools that is also capable of providing verifiable data integrity (i.e. encrypted and signed messages)

You could go for a simple obfuscation too.  libxml2 at least will write compressed XML files with no intermediary file.  It's easy enough to decompress the XML file, but it might not be immediately obvious to a reader what it is.  Gives you protection against the casual snooper if that's all you really need.
Clay Dowling Send private email
Tuesday, June 27, 2006
XML is a metalanguage, a language language. In and of itself, it is almost nothing. If you want to create a markup language, if you follow their guidelines, then you can create an XML markup language. There are other kinds of markup languages out there (LaTeX anyone?), but almost every markup language created today is an XML language.

I feel like the Gnu/Linux guy.

XML languages are generally pretty good at marking up text. They are not good for anything else really, tho', like SAS, you can get them to "work" if you put enough effort into it.

Remember, if you're working hard, you're doing something wrong!
Steve Hirsch Send private email
Tuesday, June 27, 2006
I disagree; possibly because I'm missing something.

How is XML a language?

And the person above who said:
""marking up" text""  Note the quotes around 'marking up.'

You don't actually mark up text, you surround it with things called tags.  We're not changing text.  When I hear marking up, I think of my grade school teacher crossing out sentences  and words with red pen and puttin in corrections.  OK, rant aside.

How is XML a language?  XML, to me, is a fancy way of describing something.  I suppose you could program in it -- have a parser parse out the code and compile it but XML is not a language.  I view XML as a format of data.

These folks call it a mark-up format; even though the 'L' in 'XML' stands for language. (weird)

Quote from link above:
"Extensible Markup Language (XML) is a simple, very flexible text format derived"

operative word = 'format'

Maybe they should call it XMF?

Am I nit-picking or missing something? (no doubt I'll catch some heat for this post ;) )
Tuesday, June 27, 2006

In the old days we had something called EDI.  EDI = Electronic Data Interchange.  It's still in use today.

EDI was a rule set and an actual language.  In EDI you had things like LOOP, START/END blocks.  These codes were embedded in the data itself; kind of like XML is.

EDI Example:


Where ST, ISA, and GS are blocks and the '0001' would be your actual data you want to transmit.  In EDI, some blocks mean things like there is a rule that in an ISA header you can have multiple STs.  And for every ST, and SE must exist with the same data.  If the ST and SE data segments don't match, you assume the data is corrupt. 

In XML you could format EDI data in tags: I've not seen this done yet, but I suppose you could do it.  EDI, unlike XML, has many limitations but it's well suited for companies that want to exchange things like Purchase Orders, Sales Orders, Advanced Ship notices, and charge backs or credits.  In EDI, certain blocks describe the type of document you are sending.  For example, an EDI ST block that starts with 810 means you are expecting more blocks pertinent to an Invoice from the company that is sending you the data.  An 844 is a charge back document and an 850 is a purchase order.

(hope this don't confuse the issue further)
Tuesday, June 27, 2006
The term "markup" vis-a-vis text files refers to "marking up" text by putting some kind of metadata around the text. It's just the standard English vernacular, which has probably infected other human languages as well.

If you think about it, those red marks on your papers could be represented as <wrong>your error here</wrong> you got something right here <stupid>what were you thinking?</stupid> etc.

Like I said before, XML is a template for creating a language. I guess format and language are synonyms in this context.

And it seems like EDI is also markup text, albeit not XML.
Steve Hirsch Send private email
Tuesday, June 27, 2006
Oh, and a relational database is always a better choice to store data than XML.
Steve Hirsch Send private email
Tuesday, June 27, 2006
Always?  Would you rather represent an HTML document with a recursive SQL query?
Tuesday, June 27, 2006
Gareth Lewis,

i beleive you're correct about the xml and xml schema. i'm currently working on a windows application that will query, edit, insert xml element into xml files created by another app that we use but for life of me i can't figure out why the xml that i duplicated (insert xml element according to what the other app place) the file size went up from the orginal file 83k to 153k. my porgram is code in 2 with DOM. if you use the other app to add another xml element, the file size will only go up to 85k from 83k.

i think it all have to do with xml schema but the schema that come with the application can not be open in any xml editor. i use xmlspy 2006. it will throw an error.

i guess xml have its place but isn't it more useful for exchange data across network but not use as way to store your data. won't MS access flat file type db a better soultion?
Tuesday, June 27, 2006
is it possible to treat xml file as text file and insert xml element/node by text string or DOM is better suite to program with xml files?
Tuesday, June 27, 2006
XML is a syntax for humanly readable, hierarchical data storage.

And it is almost always the wrong tool for the job.
Frank de Groot Send private email
Wednesday, June 28, 2006
It's perfectly possible to just use string functions to handle XML data. But perhaps depending on what you want to do not the best way.
Zibbo Send private email
Wednesday, June 28, 2006
to ~Eric

Do you know any "EDI for dummies" text to study it?
In Europe is still quite common and I'd like to learn more about it.

Many thanks
Sevenoaks Send private email
Wednesday, June 28, 2006
> Provide a more verbose and bloated way to store data. :)

You may laugh, but it's a little know fact that XML was invented by hard-disk manufacturers.
S. Tanna
Wednesday, June 28, 2006
"Oh, and a relational database is always a better choice to store data than XML."
"Always? Would you rather represent an HTML document with a recursive SQL query?"

Point taken. Should have said, a relational db is always a better db than XML.

Like I said before, XML is a decent way of marking up a document.

One note about XMLSpy: when I used it last (first part of 2005), it validated XML Schemas as XML documents (which they are). It didn't validate the XML Schemas as XML Schemas. Other tools do, but their names escape me at the present time.

It caused a major issue with our product release. The product was a tool for creating SPL documents, which were XML documents based on an XML Schema approved by the FDA. I was always complaining that I couldn't validate the schema _as a schema_, while other vendors were saying that they did compile the schema using XMLSpy.

By the time it was starting to get interesting, the company ran out of product development money, killed the project and let me go. Oh well.
Steve Hirsch Send private email
Wednesday, June 28, 2006
XML is a "language" but not a turing-complete programming language. The term "language" doesn't have to refer to something that can be used to produce executable code.

Thursday, June 29, 2006
is it me or MS is using XML heavily in their products?

WPF/Avalon use Xaml for GUI and desktop/web appliction create with Visual use xml as configuration file.

is XML on the rise?
Saturday, July 01, 2006

Sorry, I don't know of any books on the subject.  I don't belineve in books for dummies.  Any book that says it's for dummies is not for me since I'm not a dummie.

Anyway, EDI is an industry standard.  Each year a CD-ROM is published with all the formats.  For example, when the year 2000 was upon us, the EDI standard 4010 came about to address fields having 2 digit year blocks.  The 4010 version as it's called refers to the X12 format.  ANSI 12 that is.  ANSI x12 is the most common there is.

The CD-ROM is about $400 but if you look hard enough you can find the full ISO on the web.

You can learn a lot about EDI just by working with it and creating conversion maps.  The language of EDI is self describing.  It really is! 

For example, if you need to send 850s, purchase orders, you can look up the 850 spec and it will list every block in an 850.  The blocs are self describing.  Like, for example, you may see ADDR1 and the spec will tell you it can not repeat and this is the address line 1 of the recipient. is a good place to start.

Also, for the ISVs out there, if you can do EDI you can make a tremendous amount of money acting as a go-between.  Some of my largest customers want EDI without the hassel and so we act as a middle man.  There are lots of companies in this market with on-line EDI mappers.
Tuesday, July 04, 2006
XML has a DOM, which makes it useful for representing the webpage DOM/interface on the server, and asp.NET uses this capability as a quick way to identify elements with ID's on the aspx page.
Therefor this works: myid.text="hello world" in asp net.

We use it the same way, but we have taken it further.. much further.
Mikael Bergkvist Send private email
Sunday, July 09, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz