please help me to parser XML to sql script

admin

Administrator
Staff member
I have a xml document like this:

<?xml version="1.0" encoding="utf-8"?>
<eBay>
<EBayTime>2005-05-17 20:55:58</EBayTime>
<Categories>
<Version>28</Version>
<UpdateGMTTime>2005-03-15 04:31:36</UpdateGMTTime>
<UpdateTime>03-14-2005 20:31:36</UpdateTime>
<ReservePriceAllowed>1</ReservePriceAllowed>
<MinimumReservePrice>0.00</MinimumReservePrice>
<ReduceReserveAllowed>0</ReduceReserveAllowed>
<Category>
<CategoryId>6000</CategoryId>
<CategoryLevel>1</CategoryLevel>
<CategoryName>
<![CDATA[ eBay Motors]]>
</CategoryName>
<CategoryParentId>6000</CategoryParentId>
<IsExpired>0</IsExpired>
<IsIntlAutosFixedCat>0</IsIntlAutosFixedCat>
<IsVirtual>0</IsVirtual>
<LeafCategory>0</LeafCategory>
</Category>
<Category>
<CategoryId>6051</CategoryId>
<BOE>1</BOE>
<CategoryLevel>2</CategoryLevel>
<CategoryName><![CDATA[ Cars]]>
</CategoryName>
<CategoryParentId>6000</CategoryParentId>
<IsExpired>0</IsExpired>
<IsIntlAutosFixedCat>0</IsIntlAutosFixedCat>
<IsVirtual>1</IsVirtual>
<LeafCategory>0</LeafCategory>
</Category>
<CategoryCount>2271</CategoryCount>
</Categories>
</eBay>

I want to parser this document to sql insert script like:

insert into category(CategoryId, BOE, CategoryLevel, CategoryName,CategoryParentId, IsExpired, IsIntlAutosFixedCat, IsVirtual, LeafCategory) values(6051, 1, 2, cars, 6000, 0, 0, 0)

It's mean I passed other tags(EBayTime, UpdateGMTTime...)

Is Anyone can help me, please??? Thanks for all support...
 
Back
Top