Hi!
I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).
The XML document looks like this:
xml Code:
<?xml version="1.0" encoding="utf-8"?> <artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1"> <opensearch:Query role="request" startPage="1" searchTerms="Piano Tribute Players"/> <opensearch:totalResults>2</opensearch:totalResults> <opensearch:startIndex>0</opensearch:startIndex> <opensearch:itemsPerPage>100</opensearch:itemsPerPage> <artist href="spotify:artist:4Xx6QMLTWppMwdABkN0Afj"> <name>Piano Tribute Players</name> <popularity>0.73531</popularity> </artist> <artist href="spotify:artist:4oG2lcwDOqbB74BOE4O7o7"> <name>Piano Players Tribute</name> <popularity>0.50211</popularity> </artist> </artists>
And I need to get all that information into a class but I'm really lost.
To begin with, I don't know how to create the sub-node (artist) in a class, I've tried with Public Structure and Public Property but I think that it needs to be another class, am I right?
Here's what I currently have:
vb.net Code:
<Serializable(), XmlRoot()> _ Public Class artists Public totalResults As Integer Public startIndex As Integer Public itemsPerPage As Integer Public Class artist Public name As String Public popularity As Double End Class End Class
Another thought that I have is that the artist node isn't only one, so how would I do to create multiple artist classes....
Please help me!
//Zeelia





Reply With Quote