Thanks Debata,
Its great its working fine.
Mistake i made is: i just call the xml file and try to databind
hope its suitable for normal xml file.
but in this case we have more than one event on dates
so, it requires to use for loop on each element:
Public Shared Function CollectionBuilder(ByVal xe As XElement) As List(Of NXMLBinder)
Dim lst As New List(Of NXMLBinder)()
For Each ditem As XElement In xe.Elements()
'one date can have more than one events
For Each eitem As XElement In ditem.Elements()
Dim nxobj As New NXMLBinder()
nxobj.day = If(ditem.Attribute("day") IsNot Nothing, ditem.Attribute("day").Value, String.Empty)
nxobj.month = If(ditem.Attribute("month") IsNot Nothing, ditem.Attribute("month").Value, String.Empty)
nxobj.year = If(ditem.Attribute("year") IsNot Nothing, ditem.Attribute("year").Value, String.Empty)
nxobj.title = If(eitem.Element("title") IsNot Nothing, eitem.Element("title").Value, String.Empty)
nxobj.[when] = If(eitem.Element("when") IsNot Nothing, eitem.Element("when").Value, String.Empty)
nxobj.where = If(eitem.Element("where") IsNot Nothing, eitem.Element("where").Value, String.Empty)
nxobj.description = If(eitem.Element("description") IsNot Nothing, eitem.Element("description").Value, String.Empty)
lst.Add(nxobj)
Next
Next
Return lst
End Function
Great code and help Debata - Thanks for timely help.
Regards,
Thiru.
Thiru, if this helps please login to Mark As Answer. | Alert Moderator