• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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