I have some XML that I am trying to load directly into a MySQL table. I am fairly comfortable with the idea of \"ROWS IDENTIFIED BY\", but I am stuck at the point where I wa
As documented under LOAD XML Syntax:
This statement supports three different XML formats:
Column names as attributes and column values as attribute values:
<row column1="value1" column2="value2" .../>
Column names as tags and column values as the content of these tags:
<row> <column1>value1</column1> <column2>value2</column2> </row>
Column names are the
name
attributes of<field>
tags, and values are the contents of these tags:<row> <field name='column1'>value1</field> <field name='column2'>value2</field> </row>
This is the format used by other MySQL tools, such as mysqldump.
Since your XML is in none of these supported formats, you must use some other tool to parse it.