Gowtham Sekar
Gowtham Sekar

Reputation: 33

How to get the content of the tag by using references idref in xml

here is my code.

<music>
    <songs>
        <song id="song1">
            <song_name>taxi taxi</song_name>
            <artist_idref idref="artist2"/>
            <album_idref idrefs="album1 album2"/>
        </song>
        <song id="song2">
            <song_name>vennilave</song_name>
            <artist_idref idrefs="artist1 artist2"/>
            <album_idref idrefs="album2"/>
        </song>
    </songs>
    <artists>
        <artist id="artist1">
            <artist_name>spb</artist_name>
            <songsOfArtist idrefs="song2"/>
        </artist>
        <artist id="artist2">
            <artist_name>aadhi</artist_name>
            <songOfArtist idrefs="song1 song2"/>
        </artist>
    </artists>
    <albums>
        <album id="album1">
            <album_name>hiphop</album_name>
            <songsOfAlbum idrefs="song1"/>
        </album>
        <album id="album2">
            <album_name>melody</album_name>
            <songsOfAlbum idrefs="song1 song2"/>
        </album>
    </albums>
</music>

I want to get the content for the idrefs song1 song2 and display the content. when I displayed album details it display the song id as it is (ie) song1 song2. Instead of that i want to display that song name.

Upvotes: 1

Views: 61

Answers (0)

Related Questions