Page 1 of 1

Use <oXygen/> to transfer data between files

Posted: Wed Nov 25, 2009 3:24 pm
by headandneck
Hello,

My job sometimes involves transferring data between two differently formatted XML files.

For example, I am given a file containing the following

<track>
<id type="finetunes">1248354184270</id>
<id type="isrc">DEQ200900072</id>
<position>1</position>
<cdsourcenum>1</cdsourcenum>
<title>Death By House (Adam Beyer & Jesper Dahlbäck Remix)</title>
<version />
<copyrightinfo>Cocoon Recordings 2009</copyrightinfo>
<productioninfo />
<publisher>copyright control</publisher>
<origincountry>DE</origincountry>
<bundled>false</bundled>
<explicitlyrics>false</explicitlyrics>
<live>false</live>
<instrumental>false</instrumental>
<acoustic>false</acoustic>
<tracklength>510</tracklength>
<prelisteningoffset>138</prelisteningoffset>
<priceband>Standard</priceband>
<label>
<id type="finetunes">1142937657280</id>
<id type="gvl">11279</id>
<name>Cocoon Recordings</name>
<website>www.cocoon.net</website>
</label>
<artists>
<artist>
<id type="finetunes">1248354184270_comp</id>
<role>composer</role>
<name>Faki, Len</name>
</artist>
<artist>
<id type="finetunes">1212401354377</id>
<role>performer</role>
<name>Len Faki</name>
<website />
</artist>
</artists>
<genres>
<genre>
<id type="finetunes">700</id>
<name>Electronic</name>
</genre>
</genres>
<schedules />
<distributionterritories />
<resource type="audiofile">
<datatype>audio/mp3</datatype>
<uri>1248354180363/1248354180363_1_1_low.mp3</uri>
<licenseinfo>
<play>-1</play>
<copy>-1</copy>
<export>-1</export>
<burn>-1</burn>
</licenseinfo>
<quality type="bitrate">32-96</quality>
<quality type="size" />
<quality type="duration">510</quality>
<checksum type="md5">f26fa2ab90ef6d2fdd7dac64f2ac552d</checksum>
</resource>
<resource type="audiofile">
<datatype>audio/mp3</datatype>
<uri>1248354180363/1248354180363_1_1.mp3</uri>
<licenseinfo>
<play>-1</play>
<copy>-1</copy>
<export>-1</export>
<burn>-1</burn>
</licenseinfo>
<quality type="bitrate">320</quality>
<quality type="size">12684281</quality>
<quality type="duration">510</quality>
<checksum type="md5">38db7717c6b886772f42acf588af6d92</checksum>
</resource>
<resource type="audiofile">
<datatype>audio/wav</datatype>
<uri>1248354180363/1248354180363_1_1.wav</uri>
<licenseinfo>
<play>-1</play>
<copy>-1</copy>
<export>-1</export>
<burn>-1</burn>
</licenseinfo>
<quality type="samplerate">44100</quality>
<quality type="channelmode">stereo</quality>
<quality type="size">90091052</quality>
<quality type="duration">510</quality>
<checksum type="md5">311e32d7c3ebd089965fd8015b788d93</checksum>
</resource>
</track>

and have to transfer information from the <title> and <id type="isrc"> tags (the rest is incidental) into the following format

<track> <title></title>
<tracknumber>01</tracknumber>
<track_artist_name></track_artist_name>
<pubcode></pubcode>
<isrc></isrc>
<filename>01.wav</filename>
<bundled></bundled>
<featured_artists_artist_name></featured_artists_artist_name>
<composer></composer></track>

<track> <title></title>
<tracknumber>02</tracknumber>
<track_artist_name></track_artist_name>
<pubcode></pubcode>
<isrc></isrc>
<filename>02.wav</filename>
<bundled></bundled>
<featured_artists_artist_name></featured_artists_artist_name>
<composer></composer></track>

For a long time now i've been doing this by hand, copying and pasting the information by hand. Could oXygen do this for me automatically?

Thanks

Re: Use <oXygen/> to transfer data between files

Posted: Wed Nov 25, 2009 3:39 pm
by sorin_ristache
Hello,

You can do the transformation with an XSLT stylesheet. Oxygen helps you both to create and edit the XSLT stylesheet and to apply it to the XML document that must be converted.


Regards,
Sorin