Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Error when creating a new instance of XML::Writer

by karlgoethebier (Monsignor)
on Nov 09, 2012 at 10:20 UTC ( #1003095=note: print w/replies, xml ) Need Help??

in reply to Error when creating a new instance of XML::Writer

You can get the XML from mysql for free.

mysqldump --xml --compact dbname > out.xml


my $db=qq(classicmodels); my $xml= qx(mysqldump --xml --compact $db);
<?xml version="1.0"?> <mysqldump xmlns:xsi=""> <database name="classicmodels"> <table_structure name="customers"> <field Field="customerNumber" Type="int(11)" Null="NO" Key="PR +I" Extra="" Comment="" /> <field Field="customerName" Type="varchar(50)" Null="NO" Key=" +" Extra="" Comment="" /> <field Field="contactLastName" Type="varchar(50)" Null="NO" Ke +y="" Extra="" Comment="" /> <field Field="contactFirstName" Type="varchar(50)" Null="NO" K +ey="" Extra="" Comment="" /> <field Field="phone" Type="varchar(50)" Null="NO" Key="" Extra +="" Comment="" /> <field Field="addressLine1" Type="varchar(50)" Null="NO" Key=" +" Extra="" Comment="" /> <field Field="addressLine2" Type="varchar(50)" Null="YES" Key= +"" Extra="" Comment="" /> <field Field="city" Type="varchar(50)" Null="NO" Key="" Extra= +"" Comment="" /> <field Field="state" Type="varchar(50)" Null="YES" Key="" Extr +a="" Comment="" /> <field Field="postalCode" Type="varchar(15)" Null="YES" Key="" + Extra="" Comment="" /> <field Field="country" Type="varchar(50)" Null="NO" Key="" Ext +ra="" Comment="" /> <field Field="salesRepEmployeeNumber" Type="int(11)" Null="YES +" Key="" Extra="" Comment="" /> <field Field="creditLimit" Type="double" Null="YES" Key="" Ext +ra="" Comment="" /> <key Table="customers" Non_unique="0" Key_name="PRIMARY" Seq_i +n_index="1" Column_name="customerNumber" Collation="A" Cardinality="1 +22" Null="" Index_type="BTREE" Comment="" Index_comment="" /> <options Name="customers" Engine="MyISAM" Version="10" Row_for +mat="Dynamic" Rows="122" Avg_row_length="114" Data_length="13992" Max +_data_length="281474976710655" Index_length="4096" Data_free="0" Crea +te_time="2012-11-09 09:53:36" Update_time="2012-11-09 09:53:36" Colla +tion="latin1_swedish_ci" Create_options="" Comment="" /> </table_structure> <table_data name="customers"> <row> <field name="customerNumber">103</field> <field name="customerName">Atelier graphique</field> <field name="contactLastName">Schmitt</field> <field name="contactFirstName">Carine </field> <field name="phone">40.32.2555</field> <field name="addressLine1">54, rue Royale</field> <field name="addressLine2" xsi:nil="true" /> <field name="city">Nantes</field> <field name="state" xsi:nil="true" /> <field name="postalCode">44000</field> <field name="country">France</field> <field name="salesRepEmployeeNumber">1370</field> <field name="creditLimit">21000</field> </row> <!-- Skipped the next 20.000 lines... -->

If that is it what you want.

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003095]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-05-23 19:04 GMT
Find Nodes?
    Voting Booth?