Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
I searched the internet left and right for the answer to this question, but so far I couldn't find anything comprehensible. It seems like, okay, you make your own markup, now what? The browser can't read it, you're stuck with a bunch of plan text to which you have to write your own parser (be in PHP or some other language). If that's so, what's the point of the XML standard? Did I miss the point entirely? Time for XML discussion.
I think it's all about cross platform capability, but I don't buy into that to much. I think it would be easier just to write a script that would format the data in a csv format or something similar. I have never really been to impressed with XML from what I have seen.
I searched the internet left and right for the answer to this question, but so far I couldn't find anything comprehensible. It seems like, okay, you make your own markup, now what? The browser can't read it, you're stuck with a bunch of plan text to which you have to write your own parser (be in PHP or some other language). If that's so, what's the point of the XML standard? Did I miss the point entirely? Time for XML discussion.
Cheers!
Actually the browser can read it. You just need to write a DTD for it
XML parses extremely easily too... this makes it excellent for config files.
It is a standardized way of structuring information (markup language), but without a specific set of tags. It is entirely flexible in that anyone or any program can create their own "format" as an extension to accomidate their data. Anything can be stored in XML files as it, in the end is just a very basic and loose file interchange specification.
feyd wrote:Extensible Markup Language - says it in the name.
It is a standardized way of structuring information (markup language), but without a specific set of tags. It is entirely flexible in that anyone or any program can create their own "format" as an extension to accomidate their data. Anything can be stored in XML files as it, in the end is just a very basic and loose file interchange specification.
XML wasn't really meant to be written by hand. It is best written by a computer for other computers. As I said before, it is an interchange format. Just like JFIF, RIFF, and several other file formats you may know.
evilmonkey wrote:
That's nice. By the same token, I can do this:
Then write a program that will scan that text for a colon
And what happens when the text has a colon in it? Or multiple? What if the colons are meaningful?
Thats the beauty of a standard data interchange format. Instead of having to write a 3,000 line html parser for yahoo finance, AND a 2,000 line html parser for phpdn, AND.. AND..
Each with custom "check for a colon, and then a paragraph tag, and then .. " logic, you can simply do an xml pull, and start traversing the tree.
Standard data interchange formats mean you can consistently access data from multiple sources in a reliable format.
So here's what I'm getitng: basically it's data, in a structured form. You know the structure, but you have no idea what kind of data to expect. Like a grade 9 English essay, the rules of XML can't be bent to accommodate an "artistic style". You have to write your own parser. You need to have a vague idea of what the data is for the paser to be meaningful. XML is means to an end, it is by no means the be-all, end-all, nor does it really do anything on its' own. I'm starting to see its uses for certain things, but nothing I'm working on at the moment (that's why I wanted to know what the use of it is).
This thread was inspired by a quote I found while researching XML: "XML is a giant leap in no direction at all". Just wanted to know what people use it for.
Coming from a documentation stand point I view XML as a "structured content" component of information where a normal document has both structural content and format.
Consider XML as being similar to HTML without any format. (i.e HTML=structure and CSS=format) Now you can use a Document Type Definition to ensure that you fulfill certain criteria, e.g <h2> must follow an <h1> and so on (remember no format). Rather than a <bold> tag you have <emphasis> and/or <index>. It means a company can have a standard structure which aids both human and computer reading. (It is often the case that a structure/the format of the document changes depending on what side of the bed a person gets up on). Knowing that <h1> always is first means getiing all <h1>'s in all documents it likely to give us the document title. Using XML and DTD's can even help checking if documentation fullfils contractual obligations (Technical Writers often have to structure/format a document in a specific way, especially in military contracts).
Now add to this some intelligence coding (Automatic index, table of contents, glossary words etc) which have all been "correctly" tagged in the document. Complex documentation is simplified...
Then add format aspects to the XML similar to using different CSS files in HTML. Screen/Printer/Mobile etc can each be formatted in a different way, emphasis can be coloured or underlined in a way which enhances the user experience (that's why I used emphasis rather than bold). The same document could have different accessibility levels to show more information to specific people or any number of things.
When transfering information between systems format has "no" value. It is not needed and processing it is often an overhead so XML is often used to simplify transfering information in a standard way.
Another useful aspect is potentially reusability. If a paragraph is used in multiple places we simply place a tag reference to this and our "system code" automatically fills it in for us reducing the chance of typing errors.
Of course with anything like this there are downsides. Parsing is not always simple especially in complex DTD's, especially for non-techie people. People often find the idea of separation of content and format hard to comprehend, (what is the difference between bold and emphasis ?). DTD's can be a nightmare etc, etc..
A lot of people of jumped on the "bandwagon" without realising what XML is, it's benefits and disadvantages and so it's use is often abused (the same thing is happening with Ajax) but it is a very powerful tool in any "techhie" toolkit.
XML is great. If you're a manager it's a useful buzzword that you can use in meetings to give people the impression you're right on the bleeding edge of web development.