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