12-17-2002, 06:08 PM
I am having trouble figuring out where or why XML should be used. I began looking at it because I wanted to have a simple way of creating a database table to hold dates of interest that would be loaded to a page when the user opened a calendar. The pop up for each of the days would get it's text from the table. I was led to believe that XML was the direction to go, but my reading so far hasn't shed any light.
Some clarification would be nice.
12-17-2002, 06:56 PM
XML is ideal for sitatuations where a DB would be overkill but a flatfile too complex (or tedious) to delimit and parse
XML is also ideal for storing data where disparate processes need to access it, without them having to be on the same platform, or server, or use the same process
XML can be used to write other markup languages
With XML you have total separation of style and content
Does that help? Maybe you have more specific questions?
12-17-2002, 08:11 PM
I'll chew on your response for a while to see if what you said fits my needs, however, my immediate reaction is to look at another route.
My appointments or dates of interest include a month day and description. When the web page loads I want to inlcude this info as an array for a tool tip routine. As the user browses the calendar and hovers over a marked date, the tool tip will show what is happening on that day. Right now the info is static on the web page in an array. My thinking was there must be an easier way to change the info and keep it updated. Almost all information is known for the entire year so it is not that big of a deal.
Thanks for your response.
12-17-2002, 09:54 PM
I've been doing a lot of this kind of small-scale application with XML as the data source - for things like news indexes, timetables and product-info pages - where all the core data is in one XML doc and then I have a few different processes parsing it in different ways, so that users can sort and search through individual pages, and re-order the elements by their own priorities.
But the #1 advantage I've found with XML as a data medium its portability. XML can represent anything from a textfile to a photograph - or both, from the same XML! We're doing stuff at work where our website (apache/php) shows information to the public, and our intranet (iis/asp) shows the same information but in a completely different order and format. The possibilities are endless ....
I'm a big fan .... as my rant surely testififes :D
03-04-2003, 05:49 PM
Obvioulsy it has taken me a while to get back to this post (work is keeping me from playing). The amount of data I want to display can be three or four events in a single day and several days per month. Each event should have the start time, end time (which may be three days) type of event and location. For example on March 9 through March 11 the pop up would say;
all day - Registered Paint Horse Show, Houston Livestock Show and Rodeo, Astro Arena.
March 4th would say; 11:00am - 4:00pm, Horse Judging Competition, Houston Livestock Show and Rodeo, Astro Arena
And a bunch more.
I also want to give the kids a page where they can sell things (like a classified adds page. Managed by me.) So I would like to be able to easily enter the data that would ID the seller, describe the item and have a photo if available. I figured I would use MySQL for the DB.
Perhaps this will help you understand where I am going and why I was thinking XML may be useful here.
Comments are welcome.
03-05-2003, 11:33 AM
I think XML would be very useful to you; you're dealing with a fairly small amount of very structured data - keeping it in XML would allow you to provide more than one kind of output - for example, you could have a "coming soon" page, which lists the forthcoming events in a straightforward "list and headings" way; but you could also build an interactive calender - using the same XML to make a "point and click" style accessory to put on your pages.
Just some thoughts; mySQL would work as well - but with XML you have a ready-made transformation language (XSL) which would make the outputs much easier to manage. Also with XSL, the transformation is platform independent - you can move to a different server or rebuild your whole site, without having to modify the XML at all :)
03-05-2003, 05:20 PM
Thanks for the input!
I guess I stll have a lot more reading to do before I get a grip on the "big picture" using XML. The tutorials I have found and the book I am using all say exactly the same thing. They don't tie in the overall development apsects.
[HUH?] (future tag like :confused: )
Here's the first page of my document and the user clicks on an item to open a new page that I want to serve using php. The new page is an XML document with embedded XHTML for format using the XSL to interpret the XML tags?
The below is by liorean:
What is XML?
(see W3C XML in 10 points (http://w3.org/XML/1999/XML-in-10-points))
XML is a set of technologies (see W3C Extensible Markup Language (XML) (http://w3.org/XML/)) for:
Syntax rules for describing document structure (XML well-formedness)
Describing languages that uses the xml syntax rules to describe document structure (DTD, XML Schema, XML Namespaces)
Describing relationships and interactions between structure, data and documents (XLink, XInclude, XPath, XPointer)
Describing how to handle the document structure (xml-stylesheets: XSL (XSLT for transforming into other docuemnt structures, XSL-FO for translatingthe document structure into presentation), CSS (for describing the presentation for the document structure) and other stylesheet languages for their respective usages)
Describing processing (Processing instructions, PI) to apply to a document
XML is not:
A programming language
The best language for all situations. CSS for example is far easier and more readable than it's XML equivalent would be.
A way to describe semantics (at the moment we must use human-readable specifications and describtive names on structure elements for semantics since we have no way of describing semantics to the computer)
Properties of XML:
Textual structure representation that is human readable but intended not for humans but for computer interpretation
Verbose instead of compact
What an XML language is:
A structure description language that conforms to the xml syntax rules
The words, phrases and grammar of an xml document (provided by DTDs or XML Schema)
What an XML document is:
A single-root hierarchical tree of elements described by their type where each element in turn describes the data and elements it contains
How do I use XML?
Normally you shouldn't be concerned with using XML. XML is a way to structure raw data that isn't made for representing documents - if you want to send data between a server and client of between two programs, XML might be the choice to make, but not for a document. Instead, you should search out or create the XML language that is best for representing your document, be that MathML, SVG, XHTML, Docbook, RDF or any other. As for using XML for databases, I'd say it's pretty ok for anything intended for editing raw source by humans, but otherwise use a real database software. XML is not made for speed or efficiency, and is way larger (more verbose) than necessary.
The above is by liorean.
12-30-2003, 03:00 PM
I think what u would need better in this situation than XML is the Tabular Data Control. :D
02-06-2004, 06:16 PM
So, in essence, I can use access database to export into delimited format that is made for xml, export a database info into xml and have it display to a corporate website for analysis. Is that what we use in application in business sense? Or am I taking things wrong? (using it between servers or two applications)
07-01-2004, 04:01 AM
XML doesn't seem so exciting at first. But XSL makes it fun. With XSL, you can display the content of your XML file in tables, loop them, use if / else branching, and more. XSL is a W3C standard for the web. This is great since XML can be used for many things. But I don't think XML will replace any binary database systems (although there is the Binary XML work group...). At this time, XML is mostly used for organizing personal things. It can be great for exchanging easily readable data that can be handled by various programs. You control your XML file. The only rules you must be bound by are it's well-formedness.
XSL is the only web standard for transforming and viewing XML. But it's not the only way to view manage XML. I'm sure several corporate networks have personal XML databases with their own doctypes, along with software to read and write to the XML file to suit it's purposes. And as the XML file changes, the XSL page will display it's format. With the right uses of XSL's "when" and "otherwise" tags, you'll never even need to update the XSL page or manually edit the XML file outside of the applications. But since XSL can't write files (can't write to the web), there's no standard way to handle XML. It's up to the application handling the XML to decide on a script. The writing part may be proprietary, but it's still an XML file obeying the standards of XSL regardless of how the server maintains it, and that's what matters.
07-17-2005, 08:46 AM
XML is great as a way to share data between applications. I'd much rather have my documents stored as XML and readable by anything, as opposed to some proprietary format like MS Word doc files.
If you're using a low level language like Java or C++ (yes, I know....5 years ago those were my epitome of "HLL"s), XML is a nice alternative to using a relational DB. Though it's been my experience that, in the end, it's simpler and easier to stuff everything into mysql than waste my time playing with the xml details. (doc->children, children->nodes, getNodesByName( name) or whatever).
It all totally depends on your wants & needs. If you want to share your data with everyone else...maybe an xmlrpc server is the way to go.
If you want to create data files that lots of different applications share, maybe XML is the answer.
[Please forgive if this turns out to be a duplicate post. I wound up logged out in the middle of writing it]
From your description at the top of this post, this really doesn't sound like "the" answer. Unless you're a major player, getting an XML schema noticed just isn't going to happen. It's every bit as easy (if not easier) to stash this sort of info in a relational database. It'll [probably] be faster for the server to query.
If your site turns huge? Hire someone to implement an xmlrpc server so clients can peek at your calendar that way. If the site doesn't take off? You didn't waste the time futzing with the XML layer in the first place.
NOTE: For actual desktop applications, or other approaches, I advocate a totally different approach. Each problem requires a unique solution. Sometimes (rarely) the proprietary binary file is the right one.
07-30-2005, 04:18 AM
XML is indeed a very useful file-type
it's not much of a language but rather it is a useful DB source
usually used for connection to a game server
also used in common Speech databases for a game
also used to compile a database into basic source
*I may be wrong, hopefully I don't get flamed*
*ducks for cover with briefcase*
04-05-2006, 04:59 PM
The most appropriate place i can find xml to be used is generally using a server side language to populate an xml page, similarly to an sql view (but you don't have to keep to 2d data etc) so that distributed applications (for example those dynamic signatures that show game statistics) can read them without direct sql access. This is a pretty good, secure (when sql injection is definately blocked) way of allowing distributed applications read only access to certain areas of a database in a structured way. AFAIK it is best seen as a simple structured data store that doesnt rely on formatting (such as 10 bytes in or delimited by whitespace or commas) but provides data via metadata as tag names
06-13-2006, 04:46 AM
let me say it in this way:
XML is not built to do ANYTHING
XML is good for storing data that can be acessed with XQuery
XML should be used because it is an ideal language to discribe data
for example HTML would be a new student you do not know at all, HTML table to XML can be a furniture, data or anything when XML does not know anything about it, so to XML to make sence you can try to see it as a stupid language that thinks of everything as undefined data, although by saying it is extensive, it is the truth:
XQuery: XQuery for XML is the same as SQL for tables
XSL(T): XML Stylesheets, a way to turn xml to html, but in style, defines look
XML: eXtensive Markup Language, a language extensed by other languages
XForms: XML Forms
XLink: XML defined Link
DTD: A powerful language for defining XML elements, can generate XML to XHTML
XHTML: HTML that is defined and accepted into the XML family (.html, .xml)
so... yeah, try www.w3schools.com and check out the technologies