MySQL Forums
Forum List  »  Connector/Node.js

mysql 5.6 - loax xml - loading data from child tag
Posted by: RAVI VIDELA
Date: August 11, 2011 12:11PM

Hi,

I am using MySQL 5.6 for loading XML file into database table. I found "LOAD XML" is very useful for this purpose. However, I am facing a problem in loading data of child tag. Below is sample XML file.

<companies>
<company id=1 name=test>
<titleArts>
<image url="http://img-origin.abc.com/bed5.jpg"; creditLine="" selected="true"/>
</titleArts>
<widePosters>
<image url="http://img-origin.abc.com/6ac6c0.jpg"; creditLine="" selected="true"/>
</widePosters>
<posters>
<image url="http://img-origin.abc.com/1.jpg"; creditLine="" selected="true"/>
<image url="http://img-origin.abc.com/2.jpg"; creditLine="" selected="false"/>
</posters>
</company>
</companies>

As you can see titlearts, wideposters, posters have image tag. If i use load xml and specify <image> tag, It will load all 4 records. But i want to load only data from posters tag. If i use tag <posters>, It is only loading last record. But i want to load both 2 image url's with in posters tag. How can i do this? Appreciate your help on this.

Thanks
Ravi

Options: ReplyQuote


Subject
Written By
Posted
mysql 5.6 - loax xml - loading data from child tag
August 11, 2011 12:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.