automated conversion Mysql Table into an XML-File - Preserve hierarchy -



automated conversion Mysql Table into an XML-File - Preserve hierarchy -

i want convert lines of table xml hierarchial structure. mysql-table structured this:

---table construction create table if not exists `carrier_template_helper` ( `carrier_id` int(5) not null default '0', `tarifs_v` int(10) not null default '0', `customer_f` varchar(30) not null, `templates_f` varchar(30) not null, `page` int(2) not null default '1', `customer_f_contains_str` varchar(100) not null,

replace_str varchar(100) not null, add_str_before varchar(100) not null, add_str_after varchar(100) not null, call_method varchar(50) not null, font_size float not null default '8', add_xy varchar(10) not null default '0:0', key carrier_id (carrier_id,tarifs_v,customer_f,templates_f) ) engine=myisam default charset=latin1;

insert `carrier_template_helper` (`carrier_id`, `tarifs_v`, `customer_f`, `templates_f`, `page`, `customer_f_contains_str`, `replace_str`, `add_str_before`, `add_str_after`, `call_method`, `font_size`, `add_xy`) values (80, 2, 'billing_city', 'posbilling_city', 1, '', '', '', '', 'switch_to_city', 8, ''), (80, 2, 'billing_street1', 'posbilling_street1', 1, '', '', '', '', 'switch_to_street1', 8, ''); (80, 11, 'billing_city', 'posbilling_city', 1, '', '', '', '', 'switch_to_city', 8, ''), (80, 11, 'billing_street1', 'posbilling_street1', 1, '', '', '', '', 'switch_to_street1', 8, ''); '

and need xml hierarchy of carrier_id->tarifs_v , rest...something in pseudocode

<?xml version="1.0"?> <!doctype ...........> <carriers> <tarifs> <customer_f>2</customer_f> <tarifs_v>billing_city</tarifs_v> <templates_f>posbilling_city</templates_f> . . . <tarifs> <tarifs> <customer_f>11</customer_f> <tarifs_v>billing_city</tarifs_v> <templates_f>posbilling_city</templates_f> . . . <tarifs> </carriers>

i love automate that...what tool utilize easiest , best?

i utilize mysql console -x alternative returns results xml + xslt transformation.

mysql xml export

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -