Incorporating foreign XML data into database
Posted: Thu Jan 11, 2007 10:05 am
Hello,
Am very new to XML and was wondering if Oxygen is the program that we should be using. Our XML structure and schema for our database is different than the XML output structure of our clients. Our base structure looks like:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE document SYSTEM "http://www.XXXX.com/XXXX.dtd">
<document>
<release
title="XXX"
labelName="XXXX"
artistName="Bob Sapp"
genreId="103"
typeOfRelease="EP"
catalogNumber="WSB001"
releaseDate="2007/07/05"
upc=""
coverArtFilename="X3.jpg">
<track-list>
<track
title="Night"
mixTitle="Original"
artistName="Bob Sapp"
remixerName=""
genreId="103"
price="regular"
length="6:30"
areaId="40102"
copyright="Yes"
promoMix="Yes"
isrc="ZA-C67-060XXXX"
However we receive completely different XML output from our clients. The necessary data is the same however, we need to convert their XML into our schema. A copy of one of our clients XML output files is below:
<?xml version="1.0" encoding="UTF-8"?><package>
<major_version>1</major_version>
<minor_version>0</minor_version>
<album>
<album_id type="upc">708XXXX926</album_id>
<catalog_number>G40009</catalog_number>
<album_title>If It Ain't Been In A Pawn Shop, Then It Can't Play The Blues</album_title>
<album_release_date>2001-09-23</album_release_date>
<album_original_release_year>2001</album_original_release_year>
<album_label_name>Galapagos4</album_label_name>
<album_genres>
<genre>Hip Hop</genre>
</album_genres>
<album_explicit_lyrics>Yes</album_explicit_lyrics>
<album_copyright_cyear>2001</album_copyright_cyear>
<album_copyright_ctext>Galapagos4</album_copyright_ctext>
<album_copyright_pyear>2001</album_copyright_pyear>
<album_copyright_ptext>Galapagos4</album_copyright_ptext>
<album_recording_location>
<description>Chicago, IL</description>
</album_recording_location>
<album_artwork_files>
<file>
<file_name>cover.jpg</file_name>
<checksum type="md5">a6d5c461b58101113222acbd8232623e</checksum>
</file>
</album_artwork_files>
<album_display_artist>Qwel</album_display_artist>
<album_products>
<album_product>
<sales_start_date>2001-09-23</sales_start_date>
</album_product>
</album_products>
<album_artists>
<artist>
<name>Qwel</name>
<primary>true</primary>
<roles>
<role>Performer</role>
</roles>
</artist>
</album_artists>
<album_tracks>
<track>
<track_isrc>USI4R0502892</track_isrc>
<track_title>Quest For Fire</track_title>
<track_copyright_cyear>2001</track_copyright_cyear>
etc etc...
Can someone please point me in the right direction for how to create a template or macro for converting our clients XML to meet our standards?
Also, can Oxygen do batch conversions? We are getting thousands of these XML files, but they all have to be converted!
Sorry for the naive questions and thank you for any help in advance
Bob
Am very new to XML and was wondering if Oxygen is the program that we should be using. Our XML structure and schema for our database is different than the XML output structure of our clients. Our base structure looks like:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE document SYSTEM "http://www.XXXX.com/XXXX.dtd">
<document>
<release
title="XXX"
labelName="XXXX"
artistName="Bob Sapp"
genreId="103"
typeOfRelease="EP"
catalogNumber="WSB001"
releaseDate="2007/07/05"
upc=""
coverArtFilename="X3.jpg">
<track-list>
<track
title="Night"
mixTitle="Original"
artistName="Bob Sapp"
remixerName=""
genreId="103"
price="regular"
length="6:30"
areaId="40102"
copyright="Yes"
promoMix="Yes"
isrc="ZA-C67-060XXXX"
However we receive completely different XML output from our clients. The necessary data is the same however, we need to convert their XML into our schema. A copy of one of our clients XML output files is below:
<?xml version="1.0" encoding="UTF-8"?><package>
<major_version>1</major_version>
<minor_version>0</minor_version>
<album>
<album_id type="upc">708XXXX926</album_id>
<catalog_number>G40009</catalog_number>
<album_title>If It Ain't Been In A Pawn Shop, Then It Can't Play The Blues</album_title>
<album_release_date>2001-09-23</album_release_date>
<album_original_release_year>2001</album_original_release_year>
<album_label_name>Galapagos4</album_label_name>
<album_genres>
<genre>Hip Hop</genre>
</album_genres>
<album_explicit_lyrics>Yes</album_explicit_lyrics>
<album_copyright_cyear>2001</album_copyright_cyear>
<album_copyright_ctext>Galapagos4</album_copyright_ctext>
<album_copyright_pyear>2001</album_copyright_pyear>
<album_copyright_ptext>Galapagos4</album_copyright_ptext>
<album_recording_location>
<description>Chicago, IL</description>
</album_recording_location>
<album_artwork_files>
<file>
<file_name>cover.jpg</file_name>
<checksum type="md5">a6d5c461b58101113222acbd8232623e</checksum>
</file>
</album_artwork_files>
<album_display_artist>Qwel</album_display_artist>
<album_products>
<album_product>
<sales_start_date>2001-09-23</sales_start_date>
</album_product>
</album_products>
<album_artists>
<artist>
<name>Qwel</name>
<primary>true</primary>
<roles>
<role>Performer</role>
</roles>
</artist>
</album_artists>
<album_tracks>
<track>
<track_isrc>USI4R0502892</track_isrc>
<track_title>Quest For Fire</track_title>
<track_copyright_cyear>2001</track_copyright_cyear>
etc etc...
Can someone please point me in the right direction for how to create a template or macro for converting our clients XML to meet our standards?
Also, can Oxygen do batch conversions? We are getting thousands of these XML files, but they all have to be converted!
Sorry for the naive questions and thank you for any help in advance

Bob