Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 22nd, 2006, 08:17 AM
Authorized User
 
Join Date: Nov 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default XML into Listbox

I am trying to list items from an xml file into an xml file. i am successfull to some extent but the items are not displayed in the list box what can be the problem.

here is the code and the xml file :

Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim myDataDoc As New XmlDataDocument
        myDataDoc.Load(Server.MapPath("datastore/dictionary.xml"))
        Dim wordlst As XmlNodeList
        wordlst = myDataDoc.GetElementsByTagName("Words")
        Dim x As XmlNode
        For Each x In wordlst
            wordlist.Items.Add(x.FirstChild().Value)
        Next
        wordlist.DataBind()
    End Sub
XML FILE(dictionary.xml):

Code:
<?xml version="1.0" standalone="yes" ?>

<?xml-stylesheet href="dictionary.css" encoding="ISO-8859-6" type="text/css" ?>
<Dictionary>
    <Words>

        <Word>Fahim</Word>
        <Word>GOES THE QUOTE</Word>
        <Word>war</Word>
        <Word>love</Word>

    </Words>
</Dictionary>


payab
__________________
payab





Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
Binding XML to a listbox bonekrusher ASP.NET 2.0 Basics 0 March 25th, 2007 08:20 AM
!!HELP!! Value From Listbox quentinuys HTML Code Clinic 1 November 7th, 2006 01:33 AM
Help with listbox MMJiggy62 Beginning VB 6 5 July 11th, 2006 10:56 PM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.