Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7800497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:39:28+00:00 2026-06-02T00:39:28+00:00

This code is supposed to read from an existing xml file, and write the

  • 0

This code is supposed to read from an existing xml file, and write the contents into a label, however, it does not work, and i do not know where i am going wrong. Help would be appreciated.

Dim reader As New XmlTextReader(Server.MapPath("~/ex01/docP.xml"))
            'declare variable to record when a <name> element is found'
            Dim bName As Boolean = False
            'iterate through all of the nodes in the XML document'
            While reader.Read()
                'look at the node type of each node'
                Select Case reader.NodeType
                    'if node is a <name> element, remember it'
                    Case XmlNodeType.Element
                        If reader.Name = "name" Then
                            bName = True
                        End If
                        'if node is text & previous node was <name>, add it to Label'
                    Case XmlNodeType.Text
                        If bName Then
                            lblDisplayXml.Text &= reader.ReadString & "<br/>"
                            'reset variable for next node'
                            bName = False
                        End If
                End Select
            End While
        End Sub
    End Class

the xml file:

<?xml version="1.0" standalone="yes"?>
<book_club>
  <book>
    <isbn>0-13-129014-2</isbn>
    <title>JAVA How to Program (6th Ed)</title>
    <author>PJ &amp; HM Deitel</author>
    <price>£39.99</price>
  </book>
  <book>
    <isbn>0-67-232238-2</isbn>
    <title>Teach Yourself UML</title>
    <author>J Schmuller</author>
    <price>£9.99</price>
  </book>
  <book>
    <isbn>0-27-365575-2</isbn>
    <title>Practical Business Systems Development using SSADM</title>
    <author>P Weaver, N Lambrou &amp; M Walkley</author>
    <price>£34.99</price>
  </book>
  <book>
    <isbn>0-67-232422-9</isbn>
    <title>XML Primer Plus</title>
    <author>N Chase</author>
    <price>£32.99</price>
  </book>
  <book>
    <isbn>0-78-972476-6</isbn>
    <title>XML and Java from Scratch</title>
    <author>N Chase</author>
    <price>£19.99</price>
  </book>
  <book>
    <isbn>1234567890</isbn>
    <title>ASP.NET for Dummies</title>
    <author>RUA Dummy</author>
    <price>free!!</price>
  </book>
</book_club>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:39:29+00:00Added an answer on June 2, 2026 at 12:39 am

    There is no < name> element in your xml, thus label is never assigning any value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code is supposed to read postfix problems from a file and and write
The following code is supposed to read an image file and then add the
My code is supposed to read a line from the user, if the line
I'm trying to use basic Java code in Scala to read from a file
I am supposed to write a program that should read from input numbers in
The following bit of SAS code is supposed to read from a dataset which
This code is supposed to be able to sort the items in self.array based
This piece of code is supposed to go through a list and preform some
I wrote this piece of code that is supposed to redirect something written on
this is part of my code which reads an http response. It's supposed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.