|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Usefulness of XML?
I've read many of the articles on XML and XSL here at Devshed and it sounds like a worthwhile and useful technology. However, I am having difficulty envisioning how this will help me. From what I understand, one XML data source can be used to manipulate data in multiple ways, but how is this different from simply using a database?
I think what I need is a few articles on the different uses of XML data sources, all I've seen so far is formatting the output for the web. Any assistance is greatly appreciated, thanks in advance. |
|
#2
|
||||
|
||||
|
XML is quite good for things like config files for programs, sharing data over the internet/between servers. If someone wanted a copy of content from your site its a bit better to give them an XML feed rather than a username and password for your database
![]() |
|
#3
|
|||
|
|||
|
I definitely see the usefulness of sharing site content without comprimising integrity, but couldn't you just generate an XML tree from a database? In fact, I read a thread in this forum yesterday where someone held data in a MySQL database, then generated XML source and used XSL to format it... this of course further confused me :-)
|
|
#4
|
||||
|
||||
|
The scenario where you don't always have control over the infrastructure is where XML has some additional power. For example, you build a site that you are going to send to a customer but you don't want them to have to go buy a license for MSSQL Server since they run Oracle. You store your content in the universal xml datasource and your application now has no restriction.
__________________
mr... mike.rusaw@realpage.com RalPage, Inc. "I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal |
|
#5
|
|||
|
|||
|
Hi i'm a newbie to xml also, according to what you all have said, do we need a license for xml?
|
|
#6
|
|||
|
|||
|
XML is open-source
![]() |
|
#7
|
|||
|
|||
|
XML is a standard. There is no "source code". You can read about it here: http://www.w3.org/XML/
XML is just a standardized, extensible way of making up text. The cool thing is it's a standard that has been released free of charge. A lot of standards you have to pay to use. XML is free. |
|
#8
|
|||
|
|||
|
What about the speed issues with XML? I can certainly see the benefits as far as providing data to anybody regardless of what system they're using. However, for your own site from your own database, wouldn't it be better to just connect directly to the database with your pages? In tests I've done, going through an XML document to get the data is just one extra step that increases page load times. Add an XSL stylesheet to this and it's even more processing time eaten up.
Thoughts? |
|
#9
|
||||
|
||||
|
I don't think anyone would argue that direct connection to the db is not the most efficient in the simple respect of displaying a page. But, everyone doesn't need a database. For that matter why not just list everything in html and display it? To me this sounds like the same argument on a smaller level.
You are just sort of missing the point of XML. It is simply a structured method of representing data. That is the core power of xml. Extending your source for maximum unrestricted reusage, maintainability and deployment is only limited by your specific requirements. Anyway, databases make sense to some scenarios and not others. The same goes with XML and it's specific advantages for the deployment of your particular project. |
|
#10
|
|||
|
|||
|
hi, so according to what you've said... How do i practically use the xml. I undersstand the point when you said xml is useful to structure and organize data.
Let's say i have this situation: i have members table in my mysql db. When someone click show all users, i want to use xml here so that i can use xsl to format my data into nice tables. But i'm missing some point here, how do i dynamically generate the new xml since the members table will always change. The only way that i can think of is to dynamically generate the xml file periodiocally, but how do i do that...am i missing something here? please share your thoughts... |
|
#11
|
||||
|
||||
|
I am not a big mySQl guy but if you were using MSSQL you could use the "FOR XML AUTO" when making your select. This will return an XMl node set which can be translated by an XSL stylesheet. You may look into what mySQL offers as a comparison to selcting a return dataset in XML format or something.
|
|
#12
|
||||
|
||||
|
There's a missing piece in the conceptualizations of what XML should/can be used for in this conversation, one which, if taken into consideration during the development of your application, can have a very positive impact on the structure/expandability of your app.
If you're developing your application using the MVC (Model View Controller) architecture, outputing data as XML enables you to have a centralized end-point from which the View portion of your application begins. From the XML, you can then toggle between any number of available/popular output mechanisms - HTML, PDF, SVG, Swing, WML, RSS, etc. In theory, by having the M/C component of your application output XML, you're exponentially increasing the future flexibility of your app - since, as new 'view' formats become available, you can simply parse the XML into a different readable format.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#13
|
||||
|
||||
|
THe MVC is a common OOP concept but as with others it will have its limits and problems. There are tons of literature out there on this subject if you take a browse.
|
|
#14
|
|||
|
|||
|
In regards to generating your XML documents, and saving them periodically. Keep in mind that your XML file doesn't not need to be a saved XML file on disk. There is nothing stopping you from creating a PHP page, which outputs XML. Here is a good article on creating XML files within php, right here at Devshed--> http://www.devshed.com/c/a/PHP/Buil...-Trees-With-PHP
Once you create your XML page there is nothing stopping you from outputting your file as an XML file and transforming it however you see fit. To do so use the header function: Code:
<?php
// We'll be outputting a xml file
header('Content-type: text/xml');
// It will be called db.xml
header('Content-Disposition: attachment;filename="db.xml"');
// Your database and output code can go here...
// and assuming you use your XML tree class
$tree->dump();
?>
|
|
#15
|
||||
|
||||
|
Taminooooooo
__________________
"I hate quotations." -ralph waldo emerson- |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Usefulness of XML? |
| Thread Tools | Search this Thread |