You are here:  » return by node number?


return by node number?

Submitted by grig on Fri, 2007-11-09 02:51 in

I need to step through each instance of and the look through each for each instance or end then step through each instance of .

The data is stored in a DB in a table for tracks. Additional information about each track is hidden in parent nodes of the track node. Therefore, I need a way to traverse and keep track of each node in nested loops. Can you suggest a way to do this?

If I could ask for this:
xml|LABEL[1]/PRODUCT[1]/TRACK/
xml|LABEL[1]/PRODUCT[2]/TRACK/

(the example xml doesn't have multiple labels or products, but the real data will)

Here's the xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<music_database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://database.flowphonics.net/xml/rightsrouter1_6/support/rr_content_v1_6.xsd">
<label>
<label_id>FLO</label_id>
<label_name>Jerona Fruits</label_name>
<german_label_code></german_label_code>
<contact_details></contact_details>
<telephone></telephone>
<fax></fax>
<mobile></mobile>
<hyperlink></hyperlink>
<mailto></mailto>
<label_info></label_info>
<product>
<product_title>Mashton / Girl</product_title>
<product_disc_num>1</product_disc_num>
<product_format>CD Single</product_format>
<cat_number>JDG002</cat_number>
<upc>5060055993721</upc>
<country_of_production>GB</country_of_production>
<review></review>
<p_year>2007</p_year>
<c_year>2007</c_year>
<scheduled_release_date>29-10-2007</scheduled_release_date>
<product_price_tier>1</product_price_tier>
<bundle></bundle>
<number_of_discs>1</number_of_discs>
<total_play_time>721</total_play_time>
<artist>
<artist_name>Sci Phi</artist_name>
<file_under>Phi, Sci</file_under>
<artist_review></artist_review>
<artist_biography></artist_biography>
<artist_type>artist</artist_type>
</artist>
<track>
<track_title>Mashton</track_title>
<supp_title></supp_title>
<track_number>1</track_number>
<track_version>Original</track_version>
<label_imprint>Jerona Fruits</label_imprint>
<track_key>FLO_JDH002_track01</track_key>
<isrc>GBQZQ0700858</isrc>
<duration>05:57</duration>
<artist>
<artist_name>Sci Phi</artist_name>
<file_under>Phi, Sci</file_under>
<artist_review></artist_review>
<artist_biography></artist_biography>
<artist_type>artist</artist_type>
</artist>
<genre_labeldef>Dance</genre_labeldef>
<style_labeldef>Drum n Bass</style_labeldef>
<genre_clientdef></genre_clientdef>
<style_clientdef></style_clientdef>
<genre_code_clientdef></genre_code_clientdef>
<composer>D. Miln</composer>
<arranger></arranger>
<lyricist></lyricist>
<digital_rights_licensing>
<all_digital_rights>WW</all_digital_rights>
</digital_rights_licensing>
<owns_controls_publishing>
<info>Copyright Control Jerona Fruits 2007</info>
</owns_controls_publishing>
<specific_exclusions></specific_exclusions>
<explicit_lyrics></explicit_lyrics>
<priority>0</priority>
<cd_in_stock></cd_in_stock>
<dvd_store_ref></dvd_store_ref>
<price_tier>2</price_tier>
</track>
<track>
<track_title>Girl</track_title>
<supp_title></supp_title>
<track_number>2</track_number>
<track_version>Original</track_version>
<label_imprint>Jerona Fruits</label_imprint>
<track_key>FLO_JDH002_track02</track_key>
<isrc>GBQZQ0700859</isrc>
<duration>06:04</duration>
<artist>
<artist_name>Sci Phi</artist_name>
<file_under>Phi, Sci</file_under>
<artist_review></artist_review>
<artist_biography></artist_biography>
<artist_type>artist</artist_type>
</artist>
<genre_labeldef>Dance</genre_labeldef>
<style_labeldef>Drum n Bass</style_labeldef>
<genre_clientdef></genre_clientdef>
<style_clientdef></style_clientdef>
<genre_code_clientdef></genre_code_clientdef>
<composer>D. Miln</composer>
<arranger></arranger>
<lyricist></lyricist>
<digital_rights_licensing>
<all_digital_rights>WW</all_digital_rights>
</digital_rights_licensing>
<owns_controls_publishing>
<info>Copyright Control Jerona Fruits 2007</info>
</owns_controls_publishing>
<specific_exclusions></specific_exclusions>
<explicit_lyrics></explicit_lyrics>
<priority>0</priority>
<cd_in_stock></cd_in_stock>
<dvd_store_ref></dvd_store_ref>
<price_tier>2</price_tier>
</track>
</product>
</label>
</music_database>

Submitted by support on Fri, 2007-11-09 10:16

Hi,

I'm afraid Magic Parser is not designed to process hierarchical XML - is is intended to process large files consisting of many records at a single level (e.g. affiliate product feeds).

If you have already purchased Magic Parser and would like a refund please let me know, apologies for any inconvenience.

Regards,
David.