0

I dont know much about sql data base, so kindly request to undersatnd my problem.

I have task to store sql data to care dat base, so i am adopting the flow , i will export the data in xml format and parse it in core data base, so i am exporting data from sql data base into xml format but the format not coming upon my requirement

please look at this

  <table name="ex_name_details">
        <column name="exId">1</column>
        <column name="exGroupId">3</column>
        <column name="exName">Arnold Press</column>
 </table>

i am getting the above sample

but i need this in this formatt

 <ex_name_details>
    <exId>1</exId>
    <exGroupId>3</exGroupId>
    <exName>Arnold Press</exName>

i need this sample formatt .

Using PhpMyAdmin

its a sample but, i need to parse huge data, so please help

i should ask this question in other expert area but, i have full faith on you friends .

please answer.

Youaregreat
  • 79
  • 1
  • 1
  • 11
  • Possible duplicate.... This post is some what similar: http://stackoverflow.com/questions/1420205/how-to-convert-a-mysql-db-to-xml –  Mar 20 '13 at 07:48

2 Answers2

0

You can try using xsl transformations

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<table name="ex_name_details">
  <column name="exId">1</column>
  <column name="exGroupId">3</column>
  <column name="exName">Arnold Press</column>
</table>

and the xsl file

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:for-each select="//table">
      <xsl:element name="{@name}">
        <xsl:for-each select="column">
          <xsl:element name="{@name}">
            <xsl:value-of select="." />
          </xsl:element>
        </xsl:for-each>
      </xsl:element>
    </xsl:for-each>
  </xsl:template>
</xsl:stylesheet> 
shyam
  • 9,134
  • 4
  • 29
  • 44
  • will it not possible through phpmyadmin data base through any process, so i can get data without the structural tag of sql table please, my friend done this before but he is not here now – Youaregreat Mar 20 '13 at 06:44
-1

I solved this problem by manipulating my MySQL database not through phpmyadmin but through MySQL Workbench application, and using Export option as XML (not mysql XML). Works reasonably fine.