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

  • Home
  • SEARCH
  • 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 4073174
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:58:54+00:00 2026-05-20T16:58:54+00:00

I am starting out with xml and vb.net here, my xml looks like this:

  • 0

I am starting out with xml and vb.net here, my xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Steps>
  <X cmd="Message">
    <Message>Hello World</Message>
  </X>
  <X cmd="Message">
    <Message>Hello World2</Message>
    <Title>Cool Message</Title>
  </X>
</Steps>

I have enumerated the whole xml and can access the items like this in one of my method:

Function showmsg(ByVal X As XmlElement)
Dim xTitle as String = X.Item("Title").innerText
Dim xMessage as String = X.Item("Message").innerText
MsgBox(xMessage, , xTitle)
End Function

sooo, it works if all the elements are found (< Message > and < Title >).. but if for example the element “< Title >” is not found I get an error by trying to get the innerText.

Is there a way to ignore these errors, I just want to receive an empty value and not any errors. maybe there is a better way to do this?

  • 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-05-20T16:58:55+00:00Added an answer on May 20, 2026 at 4:58 pm

    You’ll need to check if

    X.Item(“Title”) Is Nothing

    before retrieving its value

    The other option is to us Try/Catch to ignore the errors, but that is going to slow you way down and get messy.

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

Sidebar

Related Questions

Just starting out in asp.net. Have just created a login.aspx page in my site
When starting out with a new application, would you rather just use an existing
I am just starting out with DI & unit testing and have hit a
I am just starting out with Silverlight (2 RC0) and can’t seem to get
So I am just starting out developing PHP web applications and have finished setting
I'm just starting out playing around with Linq Expressions and I've hit a wall.
I am starting out with Silverlight. I want to display a list of messages
I'm just starting out with the whole ajax thing and I need some help.
I'm just starting out writing trying to write a simple program in C and
I'm just starting out with WiX as I need to be able to automate

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.