masterofstuff
03-12-2006, 11:03 AM
I understand that XML is supposed to supply user readability or something, but what's the point?
|
Click to See Complete Forum and Search --> : What's the point of XML? masterofstuff 03-12-2006, 11:03 AM I understand that XML is supposed to supply user readability or something, but what's the point? NogDog 03-12-2006, 02:21 PM From http://en.wikipedia.org/wiki/Xml : The Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language for creating special-purpose markup languages, capable of describing many different kinds of data. It is a simplified subset of Standard Generalized Markup Language (SGML). Its primary purpose is to facilitate the sharing of data across different systems, particularly systems connected via the Internet. Languages based on XML (for example, Geography Markup Language (GML), RDF/XML, RSS, MathML, Physical Markup Language (PML), XHTML, SVG, MusicXML and cXML) are defined in a formal way, allowing programs to modify and validate documents in these languages without prior knowledge of their form. JayM 03-12-2006, 02:29 PM Source (http://sunsite.uakom.sk/sunworldonline/swol-02-1998/swol-02-xml.html) In short, XML is a type of formal language that might best be described as a metalanguage -- a language that can be used to describe other languages -- because it permits users to define and use their own terms and even shortcuts (called entities), making it easier to express unique content and the relationships that can exist among content elements. XML is basically an easy way of obtaining and sharing data. It allows you to create your own tags so that they (tags) actually describe the content of the element. So if you're writing content about a book, instead of using <p>This is an XML book<p> you can use something like this: <book> <title>Beginning XML</title> <description>this is an XML book</description> </book> As you can see, this is much easier to comprehend. The fact that XML is text makes it readable by any program, so you can use XML information across many applications. This is especially useful for businesses and large website when they want to extract data and store it in a database. masterofstuff 03-12-2006, 02:33 PM Thanks, I just don't really see what the deal is, are we supposed to care if stupid people can't read our scource code? I know you can make it easier to understand, but why not just have some kind of forum online where people can ask each other questions about web development...if only such a place existed...if only. JayM 03-12-2006, 02:47 PM It's not about people being able to read your source. It a way of exchanging and using data. Perhaps this article will help you understand it more. http://www.informit.com/guides/content.asp?g=xml&seqNum=215&rl=1 NogDog 03-12-2006, 02:50 PM If all you want to do is mark up some text so that it's viewable in a browser, then HTML is all you need. If instead you want to publish a set of data such that it can be accessed by any application and sorted, manipulated, crunched, analyzed, and eventually output for whatever desired purpose, all while being in a non-platform-specific format, then XML is the way to go. This is how RSS news feeds work: the news is supplied in XML format. The client news reader then can decide which/how many stories to display, which parts to display (Just the headline; or the headline, date, and summary; or the whole story; etc.). It could sort the stories by date/time, by author, or by any other data element defined in the XML for each story. In other words: think of an XML document as an open-platform, portable database. sirpelidor 03-13-2006, 04:41 PM Before XML, there were 2 major type of files in the computing world: 1) binary (like *.doc which can be read by MS word) 2) text (like *.txt or any file that can be read using comment like CAT, e.g autoexec.bat) As you can see, in order to read *.doc, you need a software that is able to understand *.doc. If you use a text editor to open *.doc, you will see a brunch of binary code (i call those: monsters). Now almost all applications can understand text document, why are we bothered to have binary file since all applications can read? Well for one, binary is faster and binary file is secure. There's also another down side for using text file. Suppose you have written a program that read first name and last name out of a text file (e.g: Joe Smith). Your program will assume first string is first name and, and a string after a space is last name right? Consider the following 2 problems: 1)someone send you a text file, read Smith Joe. Now...how does your program knows first name is now locate after space? 2) even worst... your program needs to enhance the ability to read middle name: (e.g: Joe J Smith). Are you gonna go back to your source code and modify it to read additional spaces again? 2a)What if we have a name call: Mary Ann J Smith? Now, how are we gonna draw the line programmically to tell where the middle name is? 2b)how about Jo Ann J Smith M.D ? you see... your text document will soon become a mass. Your program won't be able to intrupute your text document as effective as it was only Joe Smith. To answer your question: What's the point of XML? XML plays a middle part between binary file and text file. XML is a text file which can be read by any application, while it has the ability to easily extend the way how binary document is being intruputed by its own software application. All those Joe Smith problems I presented earilier, can be solve in a binary file very easily. But binary file can only be read by program that understands it. If you want that Joe Smith document being share among diff kinds of applications without having the deal with the text document limiation, XML is the answer. <title>Dr.</title> <firstname>Joe Ann</firstname> <middlename>J</middlename> <lastname>Smith</lastname> or <title><title> <firstname>Jane</firstname> <middlename></middlename> <lastname>Smith<lastname> I hope my explaination give you a better understanding of what XML is doing here. lenwood 03-24-2006, 07:23 PM Can someone explain (or link to) how to display XML feeds on a website? I'd like to display a newsfeed or two on my blog, but haven't figured out how to get them to display. Also, can I format a feed with CSS? Thanks, Chris aaronbdavis 03-31-2006, 05:05 PM if you want to display the XML Document as something beside the document tree, you can format it with XSLT. There is a tutorial here (http://www.w3schools.com/xsl/default.asp). It basically converts the XML into HTML, which can then be formatted with CSS. It is possible to format the XML with CSS directly, but that is not the preferable method. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |