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 8827463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:22:38+00:00 2026-06-14T07:22:38+00:00

This should be something easy to look up, but any related documentation I see

  • 0

This should be something easy to look up, but any related documentation I see fails to work in this case. Let’s say you have a response coming back from a web service call with the following XML:

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello, World!  str=1</string>

I just want to be able to extract the value – Hello, World! str=1 – without having to use string.replace() or anything else like that. If the XML were stored in a variable called response, and if the following code were called:

alert(response.documentElement.nodeValue)

“undefined” is what shows up. What the heck? I just want to get a string or any sort of ordinary primitive out of a web method (I’m not using JSON or anything), but documentation on how to do this is being difficult to find. How do you do this? Thanks!

EDIT: Here’s the code:

<WebMethod()> _
Public Function HelloWorld(ByVal str As Int32) As String
    Return "Hello, World!  str=" & str
End Function

<html>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
<script type="text/JavaScript">
    <!--
        $.ajax({
            type: "POST",
            data: "&str=1",
            dataType: "xml",
            url: "<HTTP path and filename>.asmx/HelloWorld",
            timeout: 15000,
            cache:false,
            success: function (result) {
                alert(result);
            },
            error: function() {
                alert("bad");
            }
        });
    //-->
</script>
</body>
</html>

It shows:

[object XMLDocument]
  • 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-14T07:22:40+00:00Added an answer on June 14, 2026 at 7:22 am

    Both response.documentElement.textContent and response.documentElement.firstChild.nodeValue will give you the text content with the example XML documents you have provided.

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

Sidebar

Related Questions

This seems like it should be something very easy to do, but every time
OK, I'm feeling like this should be easy but am obviously missing something fundamental
This should be a elementary question but why is better to use something like
This should be pretty simple, still I can not see what/how something could be
I feel like this should be a no brainer, but clearly I'm missing something...
So I have a text area with borders that look something like this: Any
Feel like this should be something easy that I'm missing. I have a table
Trying to figure out the best way to do this: Should I do something
This seems like it should be something I already know. We need to run
I guess the procedure should be something like this: declare @db varchar(100) declare @user

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.