I have a very simple xspf file:
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<info>This is our selection for the Easter period.</info>
I am trying to get the Title and Info elements at the top of the document using
But it just doesn't find it.Anybody knows how should I do it?
Not sure what language you are coding in but your problem is you have a namespace in your Xml and you are not querying the Xml using it. Here is some sample code that shows you how to add a namespace to solve the problem
XmlDocument xmldoc = new XmlDocument(); xmldoc.Load("Playlist.xml"); XmlNamespaceManager manager = new XmlNamespaceManager(xmldoc.NameTable); manager.AddNamespace("xspf", "http://xspf.org/ns/0/"); string title = xmldoc.SelectSingleNode("//xspf:title", manager).InnerText