Home:ALL Converter>store and query xml data in MySQL

store and query xml data in MySQL

Ask Time:2009-10-12T16:46:21         Author:Beier

Json Formatter

what are the good options to store xml structured data and query the data in MySQL? I know from mysql5.1.5 there is a function ExtractValue() to query the data directly, but due to certain limitations I can only use mysql5.0.x. what I need is to store the data in simple xml format, such as

<person>
<name>My Name</name>
<gender>male</gener>
</person>

And I need to be able to directly query all persons who are male.

Author:Beier,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/1553423/store-and-query-xml-data-in-mysql
clops :

I guess you will have to use rex-exps in your SQL in case if MySQL is below V5.1.5. This could be slow if you have a lot of data to drill through. I would consider caching these values in separate indexed columns.",
2009-10-12T09:07:49
yy