View Full Version : Returning to XML
Pauly
February 23rd, 2005, 18:04
Awhile ago I thought I would learn XML but up until recently I didn't bother. Anywho, I've been learning and wondering what the point of using XML with XHTML is?
It seems that the general / w3c desired use for XML is a standard way of sharing data, cross-platform and cross-application.
Correct me if I'm wrong please, still learning ;)
sonicgroup
February 23rd, 2005, 20:53
Where's Eric when you need him? :D
At any rate, that's essentially the desired use. The problem you run into is that you can define your own schema. So, while the data is indeed accessible cross-platform and application, if the other end doesn't know your schema, they'll have a bit of work to parse it and get the actual data out of it.
On the other hand, the benefit to that is that you can create a schema that describes your data instead of the traditional approach to data storage where you have to make your data conform to a defined set of types (i.e. in database applications where you have char, varchar, blob, int, etc.). XML is type-less. It doesn't matter what type of data is stored in an element since the element describes the data.
As for using XML with XHTML, I don't think there's any good reason to (yet). XHTML is just the next evolution of HTML which borrows heavily from some of the defining principles of XML - well-formed documents, lowercased elements and attributes, quoted attributes, and closing tags for every element (these are just the highlights - there are also several smaller things that are common to both).
Eventually, we'll probably be using strictly XML to display web pages. There are many standards out there depending on the device you use, but once we move to XML, it won't matter the device; the same document will display the same on any device.
Pauly
February 23rd, 2005, 21:06
Yea it would be really nice to have a uniform language when displaying websites. I read that things look different in different browsers generally because of the way a browser interprets an error.
It would make it easier on the browser providers if it was standard to not display non-valid code and not make interpretations, but do as it's told. Hmmm as far as I'm aware only IE doesn't do the latter :lol:
Thanks for the info.
BigBison
February 24th, 2005, 04:09
Where's Eric when you need him? :D
Right here! I'd like to point out that an XHTML document is XML. As such, if a document is not well-formed, any compliant browser must display an error message. XHTML is HTML reworked as XML. Different browsers will still have their own interpretations of things -- using XHTML does not mean uniform appearance across browsers or platforms. Non-valid code just means a document won't validate, that doesn't necessarily mean it isn't well-formed, which is all a web browser cares about when it comes to displaying a page. There are still plenty of display issues which aren't covered in the standards and are up to the browser coders, for instance is a blank line one em high or two? So display differences won't be going anywhere soon. Some software uses a validating parser in which case a document must be well-formed and valid to display, but web browsers use non-validating parsers.
Totally off-topic:
Sorry it took me 10 hours to respond here; thanks for not getting impatient and mail bombing me and leaving 39 pages though! If you don't know what I mean, here's an entertaining WHT thread:
http://www.webhostingtalk.com/showthread.php?s=&threadid=376905
Pauly
February 25th, 2005, 08:16
Thanks, but I have another question -
News and audio streaming companies use XML documents to store the latest news and playlists. Am I right in assuming that to display these you link directly to the XML document and create your own XSL or CSS to format it, and leave them to update it?
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.