LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   MySQL to XML including data, DTD and XML Schema (https://www.linuxquestions.org/questions/linux-general-1/mysql-to-xml-including-data-dtd-and-xml-schema-4175429948/)

rm_-rf_windows 10-01-2012 04:04 PM

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

takener 07-06-2015 07:16 AM

Quote:

Originally Posted by rm_-rf_windows (Post 4794324)
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...

mralk3 07-06-2015 07:37 AM

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

mralk3 07-06-2015 07:43 AM

Silly me. I just realized this is a necro....

Quote:

Originally Posted by takener (Post 5387831)
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.


All times are GMT -5. The time now is 02:50 AM.