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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:06:03+00:00 2026-06-09T01:06:03+00:00

I have a XML object and I am wanting to return the text value

  • 0

I have a XML object and I am wanting to return the text value on the node which may have a number of child nodes.

  <binding name="s"><bnode>b1fff4d00000000fe</bnode></binding>
  <binding name="p"><uri>http://cidoc-crm.org/P1F.is_identified_by</uri></binding>
  <binding name="zebra"><literal>copper</literal></binding>

In the above case i am wanting to return the text in each node were I can specify the name value of the binding.

pseudo code:
get text where binding name value == “s” ;

I have tried this

x[i].getElementsByTagName("binding")[0].childNodes[0].nodeValue

so it shouldn’t matter what the child node name is in this case bnode.

I hope thats clear

Thanks.

  • 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-09T01:06:05+00:00Added an answer on June 9, 2026 at 1:06 am

    Easiest way to get the text content would be

    x[i].getElementsByTagName("binding")[0].textContent;
    

    However, textContent is unsupported in IE < 9, so you will need to navigate through to the text node in those browsers:

    x[i].getElementsByTagName("binding")[0].firstChild.firstChild.data;
    

    Demo: http://jsfiddle.net/p2SrZ/

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

Sidebar

Related Questions

if I have an XML object like this: <a> <u date=2009-04-10 value=543/> <u date=2009-04-11
Suppose I have an Anti-XML object, e.g.: import com.codecommit.antixml._ val child = <child attr=val>...</child>.convert
I have parsed XML file into objects, in which each object has a 1:1
I have an object structure I have deserialized from XML - but I'm wanting
In a Flex application, I'm have an xml object that I'm binding to a
Within a child, I have an XML element with the following structure: <position> <startOffset>*NUMBER*</startOffset>
I have an XML object in AS3 that is formatted as follows: <data> <nodes>
I have an XML object being returned, and inside is a date and time
I have a basic XML object that I'm working with. I can't figure out
I have a datagrid with an XML object as dataprovider. There are 2 columns

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.