XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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 May 21st, 2000, 06:06 AM
dynamic1 dynamic1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Norfolk, UK
Posts: 16 dynamic1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

I've just finished reading an XML spec/schema for news stories. The concept seems to be very interesting, especially splitting style and content.

I am having problems working how to store XMLised data in a MySQL structure.

With embedded entities and a generally open structure it seems impossible to properly store this data in a flat-ish structure such as MySQL.

Where is XML meant to fit in ?

It is a transport layer .... take data from a database and convert it XML and then onto the client

Or is it for data storage / encapsulation as well ?

It's really testing the old grey matter, hopefully the penny will drop soon

Also has any1 any ideas on how to prepare for full XML useage while still maintaining compatibility with old HTML browsers.

Thanks for any comments..

Reply With Quote
  #2  
Old May 22nd, 2000, 11:42 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
I have read article after article - even 'tutorial' after 'tutorial' (quoted because they often do not actually teach you anything) on XML - and I am still buggered as to what I am supposed to do with it?

I have read all about the librarys of DTD's which authors always seem to forget the link to, well-formed vs ..... (I forget), XHTML? , XSL,,,....!!!!!

Apparantly it will help search engines to continue their fight to ignore all genuine sites.

<well-formed-cynic>Simon</well-formed-cynic>

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #3  
Old May 22nd, 2000, 01:51 PM
dynamic1 dynamic1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Norfolk, UK
Posts: 16 dynamic1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi ya,

Every one I talk to is bitching about XML. Glad I'm not the only one having problems with it all.

I have daily arguments with the Tech Manager at work. He loves XML (although has done nothing with it) and swears it is the future. His take on it all is that it is a 'transport layer', you take your data out of database, convert it to XML, send it the client, convert it back to useable data, merge it with any style and formatting, display it.


XML is also very hungry on bandwidth. Sending all the data wrapped in humanised plain text is not a very efficient way of doing things. Even a blank wap-WML page seems to take at least 10k because of DTDs etc.

I'm off to get the full W3C docs and see what exactly they say about it. It seems like the 'steering committee' may have a taken a dead end...or at least a dirt track.

Any one got any <working>XML</working> sites out there ?


Reply With Quote
  #4  
Old May 24th, 2000, 04:00 PM
jonherron jonherron is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 24 jonherron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i am also glad to see that i am not the only one that doesnt see where the hype actaully comes into play. I have been doing some work with XML, but so far my main questions is: "what advantage here is so great that i should stop everything and start to do my site in it?" Oh wow you can make your own tags and send them through your XSL doc, thats cool but not much else as i see it at this point. Maybe i am missing something (in fact i hope that i am missing something). I keep hearing "XML is huge, it is going to change the way we do everything", yet no one really seems to know how or why its so huge.

Any insight?

Reply With Quote
  #5  
Old May 25th, 2000, 06:26 AM
dynamic1 dynamic1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: Norfolk, UK
Posts: 16 dynamic1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi,

OK, heres a quick example ... I know the XML is wrong etc.. its just an example

A News Story

<news>
<date>21st June 2000</date>
<author>Me</author>
<story>
<date>Yesterday</date><person>Mr Joe Bloggs</person> had a massive <event>heart attack</event> after trying to get his head round XML.
</story>
</news>

This seems OK, but how do I now import that data into a MySQL database and then back out again as XML. I guess you will not store the tags in the database, and these will need to be inserted when it is sent back out.

Surely for every word / phrase it will have to search the database to try and find out what type of data that is and wrap it in a tag.

Am I going down the right road ????? or lost the point completely ... if there ever was a point in the first place.

Thanks..

Reply With Quote
  #6  
Old May 25th, 2000, 10:49 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
Al depends on yer <forgot the acronym>DTD's</forgot the acronyn> I suppose,

At Marthasonlinedating.com the DTD specifies the <date> tag as a pleasant social encounter with a member of the opposite sex, of course the middle eastern fruit importers.com insist that <date> is of course a kind of <from a tree><fruit type="sticky"><date>pudding</date></fruit></from a tree>.

Tis possible that Marthasonline dating may misread<event>heart attack</event> incorrectly and send him a bunch of roses instead of an ambulance ??

OK its obvious I know little of XML but please do not tell us it will make our life any easier!.


Simon.

------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL

Reply With Quote
  #7  
Old June 5th, 2000, 07:05 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
This place http://www.w3schools.com/xml/default.asp
seems to have some good information. I went through the wml/wap section last week and that seemed OK for as far as it went.
CML is the best example of XML in action. Like WML it's an industry agreed upon mark up language.

Robman

Reply With Quote
  #8  
Old June 6th, 2000, 01:57 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
I forgot to mention SVG the new graphics format. It's XML based. Check out SVG at the W3C it looks pretty cool.

Robman

Reply With Quote
  #9  
Old June 15th, 2000, 05:30 PM
Robman Robman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: SLC, UT, USA
Posts: 47 Robman User rank is Private First Class (20 - 50 Reputation Level)Robman User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14

Reply With Quote
  #10  
Old June 19th, 2000, 05:40 PM
bluginger bluginger is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 4 bluginger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You are completely on the RIGHT TRACK!

how does one get XML into mySQL. where the first alternative is to use an XML based database like eXcelon if you have $15K. if you don't then i see two options.

1) use the great XML modules (like XML::Parser) for Perl available at search.cpan.org. this will allow you to easily break up the data and store them in appropriate columns.

2) if searching is not a big deal then just store the XML as a glob and when you want to retrieve it, get the XML data and use XQL and XSL to query and present the data, respectively. XSL allows you to turn it into XML, HTML, WML, txt, whatever in a routine manner.


good luck.


<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by dynamic1:
Hi,

OK, heres a quick example ... I know the XML is wrong etc.. its just an example

A News Story

<news>
<date>21st June 2000</date>
<author>Me</author>
<story>
<date>Yesterday</date><person>Mr Joe Bloggs</person> had a massive <event>heart attack</event> after trying to get his head round XML.
</story>
</news>

This seems OK, but how do I now import that data into a MySQL database and then back out again as XML. I guess you will not store the tags in the database, and these will need to be inserted when it is sent back out.

Surely for every word / phrase it will have to search the database to try and find out what type of data that is and wrap it in a tag.

Am I going down the right road ????? or lost the point completely ... if there ever was a point in the first place.

Thanks..
[/quote]




[This message has been edited by bluginger (edited June 19, 2000).]

Reply With Quote
  #11  
Old August 4th, 2000, 01:20 AM
nilch nilch is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Calcutta, West Bengal, India
Posts: 25 nilch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
------------------------
This seems OK, but how do I now import that data into a MySQL database and then back out again as XML. I guess you will not store the tags in the database, and these will need to be inserted when it is sent back out.

Surely for every word / phrase it will have to search the database to try and find out what type of data that is and wrap it in a tag.
---------------------------------------
I guess we are all losing the point here. First of all there is a big point. When the data in your site changes daily, then it makes a VERY good sense to write XML.

Since you define the data, so you make the rules in your parser program to parse the tagged XML data and read the data (not the tags). This is done thu a spec called XML DOM manipulation. Its same as any other DOM object manupulation. By doing the necessay commands, we can read the 'DOM tree' i.e the tagged nodes and accordingly make a insert into a database of the data as fields in to mysql database.

Its a short way to explain a large topic.
But XML shows is brilliance and ease pf site maintenance in a very data volatile environment where the data changes quite often but is of the same structure.


Reply With Quote
  #12  
Old August 4th, 2000, 11:01 PM
Gil Gil is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 23 Gil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Gil Send a message via AIM to Gil
I've read a lot about XML, but I don't see the big deal. From what I can understand, it's not meant to be integrated with databases, rather it acts as its own database. The best use that I could find for it is to allow other websites to display your website's dynamic information in their format, such as news.


------------------
Aristotle concluded that those who admit their stupidity are truly wise.
-
Gil Hildebrand Jr
4atcost.com Senior Web Developer

Reply With Quote
  #13  
Old August 10th, 2000, 10:58 AM
softgazobee softgazobee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Reading, Berkshire, UK
Posts: 2 softgazobee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
For those who would like to see a good example of XML at work, try www.gingell.com

Craig has coded an xml version of his family geneology.

Reply With Quote
  #14  
Old August 26th, 2000, 06:10 AM
rock-tnsc rock-tnsc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: London, London, UK
Posts: 3 rock-tnsc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
There is a time and a place for everything and although XML has got a lot going for it and is going to become more and more common place (just see how many new books have appeared in the last 12 months on the subject) that doesn't mean that one shoe fits all.

If your data will work very happily using a normal relational database representation then use that - don't bother with XML. Just so long as you can write queries that give you your data when, where and how you need it then that's fine URL.

Now there are other times where your data can be better or more flexibly described by XML than in a relational database. Or for transport purposes maybe an XML file is better than plain text, then again a plain old HTML file might just do the job.

I'll give you an example of how I am using both MySQL and XML together in my work. I sell stone for a living and one of my bete noir's for the last couple of years has been automating the quoting system. The problem is that every single inquiry really is individual and the cost of each price has to be calculated. Now the problem has been that the way of calculating a piece of stone is different for each material. I could have hard coded this into the application but then I'm stuck whenever the parameters change or I add a new material. I couldn't store the information in a relational database because of the variable nature of the structure of the data. The solution is XML. With XML I can describe the data. When I parse the data back into my application it takes account of the descirption and constructs a suitable object which presents a standard interface to the rest of the program.

I have a separate XML file for each material meaning that I can add materials at will.

Once the price is calculated it can then conform to a relational model and I store the quote in a mySQL database.

If you still feel that XML is the right tool for your job then you have to decide where to store the XML in a database or just as text files. You can write an application to parse XML files and do everything with them that you could with data in a relational db. It's just a different approach.

To get the full advantage from XML there is no point in storing it in a db and then just using SELECT statements to search it. You've got to get the data out of the db parse it in a program.

Keeping XML in text files works fine if the volume isn't too large or they are easy to find (for example if each file was an invoice, or invoices for one client just so long as you knew which client or invoice you wanted to look up then it would be easy to find the right file). If this is not the case and you decide to store it in a db then you've probably got to store some meta data so that you can easily retrieve your XML data.

At the end of the day choose the tool to fit the task - don't use something because it's hyped.

Good Luck.

Jethro

Reply With Quote
  #15  
Old August 26th, 2000, 06:19 AM
rock-tnsc rock-tnsc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: London, London, UK
Posts: 3 rock-tnsc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I forgor to mention. An excellent book on working with XML is 'XML Processing with Python' by Sean McGrath. The author worked on the W3C SIG that standardised XML and knows his stuff. He prefers Python above all other languages for parsing XML (no flames please).

Jethro

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Storage of XML data

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap