Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
indexOf or search function issue for XML tag to get the value

I have a big XML with unique XML tag which is coming as string

I want to extract the value of an XML element

I tried the following

a. xmlString.substring(this.responseText.search('<emp:keyAddress>')+5, this.responseText.search('</emp:keyAddress>'))
b. xmlString.substring(this.responseText.indexOf('<emp:keyAddress>')+5, this.responseText.indexOf('</emp:keyAddress>'))

I am getting the following issues

a. Referenced to undeclared namespace prefix: 'emp'
b. Problem creating XSL transformer for string

How to get the value of an XML tag using Javascript? I don't like neither searchText or indexOf where i need to hard-code the length as it may differs in the future

Please advise.

Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!