hi,
Since the data displayed in the text box is in a well-formed xml format, easiest way to get the path and title attributes is loading the xml text in DOMDocument and getting the value.
Here is the code.
To test this code, Create a
VB Form, add a Multi-Line Textbox, 2 ListBoxes and a Command Button (don't change the names of the controls).
Then, Goto Project menu ---> References and select Micrsoft XML 4.0 from the list(which will be available in all systems by default)
then paste the code in the click event of the command button and paste your xml text inside the textbox and run the form and click the button.
you'll the url of the mp3 and title of the song in the both listboxes.
any further queries or updations, mail me.
--------------- Code Listings --------------------------------------
Dim xmlDoc As MSXML2.DOMDocument40
Dim songNode As IXMLDOMNode, songNodeList As IXMLDOMNodeList
'Loading all the text in to a xml dom document
Set xmlDoc = New DOMDocument40
xmlDoc.loadXML Trim(Text1.Text)
'Selecting all the Song nodes from the XML Text in the TextBox
Set songNodeList = xmlDoc.selectNodes("//song")
For Each songNode In songNodeList
'Getting the Path
List1.AddItem songNode.Attributes.getNamedItem("path").Text
'Getting the Title
List2.AddItem songNode.Attributes.getNamedItem("title").Text
Next
Set xmlDoc = Nothing
-------------------------- End of Coding -------------------------
Regards,
Raghu