LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-01-2012, 04:04 PM   #1
rm_-rf_windows
Member
 
Registered: Jun 2007
Location: Europe
Distribution: Ubuntu
Posts: 209

Rep: Reputation: 23
MySQL to XML including data, DTD and XML Schema


Hi all,

I've been Googling for over an hour and can't seem to find what I'm looking for. Perhaps it's because it doesn't exist, perhaps it's because the best computer scientists are often rotten pedagogues... Or maybe it's me, perhaps I don't know enough about XML and am on the wrong path... I don't know!

I'm trying to convert a database table into a simple XML document including data, DTD and XML Schema. It shouldn't be all that hard... Or am I wrong? I'm using MySQL.

I've seen that there are MySQL xml options, but here's what I get:
Code:
  <row>
    <field name="id">59434</field>
    <field name="item">hammer</field>
  </row>

  <row>
    <field name="id">282985</field>
    <field name="word">head</field>
  </row>
I don't want "row" and "field"!! I want these tags to be called "id" and "item" etc... a proper XML document... and DTD and XML schemas generated automatically.

Is this possible?

Or, if I'm really way off, could anybody out there give me some suggestions as to how to go about finding an XML equivalent for a single table / multiple tables?

Thanks in advance,

rm
 
Old 07-06-2015, 07:16 AM   #2
takener
LQ Newbie
 
Registered: Jul 2015
Posts: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by rm_-rf_windows View Post
Hi all,

I've been Googling for over an hour and can't seem to find what I'm looking for. Perhaps it's because it doesn't exist, perhaps it's because the best computer scientists are often rotten pedagogues... Or maybe it's me, perhaps I don't know enough about XML and am on the wrong path... I don't know!

I'm trying to convert a database table into a simple XML document including data, DTD and XML Schema. It shouldn't be all that hard... Or am I wrong? I'm using MySQL.

I've seen that there are MySQL xml options, but here's what I get:
Code:
  <row>
    <field name="id">59434</field>
    <field name="item">hammer</field>
  </row>

  <row>
    <field name="id">282985</field>
    <field name="word">head</field>
  </row>
I don't want "row" and "field"!! I want these tags to be called "id" and "item" etc... a proper XML document... and DTD and XML schemas generated automatically.

Is this possible?

Or, if I'm really way off, could anybody out there give me some suggestions as to how to go about finding an XML equivalent for a single table / multiple tables?

Thanks in advance,

rm
you finally get some solution??
ive got the same isiuse, if u can help me...
 
Old 07-06-2015, 07:37 AM   #3
mralk3
Member
 
Registered: May 2015
Location: USA
Distribution: Slackware64-current, Slackware-ARM
Posts: 403

Rep: Reputation: 106Reputation: 106
I searched "export mysql database to xml" and the first thing I found was this thread:

http://forums.mysql.com/read.php?44,59164,59164

Furthermore, there really was no need to google anything. Just check the man page for the command you have questions...

Code:
man mysql
Quote:
--xml, -X

Produce XML output.
EDIT: This is also helpful:
http://stackoverflow.com/questions/1...ysql-db-to-xml

Last edited by mralk3; 07-06-2015 at 07:40 AM.
 
Old 07-06-2015, 07:43 AM   #4
mralk3
Member
 
Registered: May 2015
Location: USA
Distribution: Slackware64-current, Slackware-ARM
Posts: 403

Rep: Reputation: 106Reputation: 106
Silly me. I just realized this is a necro....

Quote:
Originally Posted by takener View Post
you finally get some solution??
ive got the same isiuse, if u can help me...
Please do not comment on old threads. Start your own new thread if you have a question. The original post was from 2012.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTables XML DTD/Schema koosha Linux - Security 2 03-26-2011 07:26 AM
[SOLVED] IPTables XML DTD/Schema koosha Programming 1 03-26-2011 07:03 AM
xml and DTD kshkid Programming 4 04-05-2008 06:10 AM
configure: error: could not find DocBook XML DTD V4.1.2 in XML catalog Fadoksi Linux - Software 1 07-16-2006 06:41 AM


All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration