[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

load xml

I am using silverlight

i have an xml file and want to load it into a listbox in silverlight but nothing happens?

 <?xml version="1.0" encoding="utf-8" ?>
<Slides>
   <Slide>
     <Title>Slide 1</Title>
     <Text>Slide 1 Description</Text>
   </Slide>
   <Slide>
      <Title>Slide 2</Title>
      <Text>Slide 2 Description</Text>
  </Slide>
</Slides>

   Dim xmls As New XmlReaderSettings
        xmls.XmlResolver = New XmlXapResolver
        Dim reader As XmlReader = XmlReader.Create("x2.xml")

        reader.MoveToContent()

        While reader.Read
            If (reader.NodeType = XmlNodeType.Element) And (reader.Name = "slide") Then
                reader.ReadToFollowing("title")

                lb.Items.Add(reader.Value)
                reader.ReadToFollowing("text")

                lb.Items.Add(reader.Value)
            End If

            If (reader.NodeType = XmlNodeType.EndElement) And (reader.Name = "slides") Then
                Exit While
            End If
        End While
0
jagguy
Asked:
jagguy
1 Solution
 
tiagosalgadoCommented:
Check this examples to read correctly a XML file
http://csharptutorial.blogspot.com/2006/10/reading-xml-fast.html
 
0
 
jagguyAuthor Commented:
i am using silverlight  vb.net so i dont think this wil work
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now