Convert XML file to CSV

Posted by skerit on Stack Overflow See other posts from Stack Overflow or by skerit
Published on 2010-03-25T15:28:23Z Indexed on 2010/03/25 17:13 UTC
Read the original article Hit count: 416

Filed under:
|
|
|

After having converted a messed up XML using regex, I now need to change it yet again. This source file

<product>
    <sku>SP00001</sku>
    <PID_OWNER_SellerID>StoreName</PID_OWNER_SellerID>
    <EANCode>8711983489813</EANCode>
    <DeliveryDays>2</DeliveryDays>
</product>

Has to become a CSV file, but like this:

sku        field                 value
SP00001    PID_OWNER_SellerID    StoreName
SP00001    EANCode               8711983489813
SP00001    DeliveryDays          2

I take it this is outside of regex' scope and has to be done with XSL?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about csv