XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 30th, 2003, 08:37 AM
Techwhore Techwhore is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Albany, NY
Posts: 89 Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 58 m 57 sec
Reputation Power: 10
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.

Reply With Quote
  #2  
Old September 30th, 2003, 09:07 AM
a.koepke's Avatar
a.koepke a.koepke is offline
Second highest poster :p
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jul 2001
Posts: 7,323 a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level)a.koepke User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 8 h 13 m 55 sec
Reputation Power: 27
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

Reply With Quote
  #3  
Old September 30th, 2003, 09:24 AM
Techwhore Techwhore is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Location: Albany, NY
Posts: 89 Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level)Techwhore User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 8 h 58 m 57 sec
Reputation Power: 10
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 :-)

Reply With Quote
  #4  
Old September 30th, 2003, 01:58 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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

Reply With Quote
  #5  
Old October 4th, 2003, 12:53 PM
jacky_cheecheo jacky_cheecheo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 22 jacky_cheecheo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi i'm a newbie to xml also, according to what you all have said, do we need a license for xml?

Reply With Quote
  #6  
Old October 4th, 2003, 07:06 PM
ZeRO ZeRO is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 64 ZeRO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
XML is open-source

Reply With Quote
  #7  
Old October 4th, 2003, 09:04 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
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.

Reply With Quote
  #8  
Old October 13th, 2003, 11:46 AM
trevize1138 trevize1138 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Minneapolis, MN
Posts: 1 trevize1138 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to trevize1138
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?

Reply With Quote
  #9  
Old October 14th, 2003, 04:02 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
  #10  
Old March 14th, 2004, 12:37 PM
jacky_cheecheo jacky_cheecheo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 22 jacky_cheecheo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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...

Reply With Quote
  #11  
Old March 15th, 2004, 09:51 AM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
  #12  
Old March 15th, 2004, 10:03 AM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,225 drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level)drgroove User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Day 4 h 48 m 15 sec
Reputation Power: 174
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


Reply With Quote
  #13  
Old March 15th, 2004, 10:29 AM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
  #14  
Old March 15th, 2004, 10:42 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 11
Send a message via AIM to imbrokn
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(); 
?>

Reply With Quote
  #15  
Old March 16th, 2004, 01:58 AM
cliffhanger9's Avatar
cliffhanger9 cliffhanger9 is offline
fortin bra?
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: city of sin, state of the art
Posts: 418 cliffhanger9 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 19 h 5 m 18 sec
Reputation Power: 0
Send a message via ICQ to cliffhanger9 Send a message via AIM to cliffhanger9 Send a message via MSN to cliffhanger9 Send a message via Yahoo to cliffhanger9
Taminooooooo
__________________
"I hate quotations."
-ralph waldo emerson-

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Usefulness of XML?


Thread Tools  Search this Thread 
Search this Thread: