Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

Read XML Tag value

Hai All,
I have an xml file which contain data like


and I need to get the text which is between 'NAME' tag. Please answer ASAP.

the $name should get the text 'ABCD'
Eg: Name = ABCD


  • Hai,
    This is the answer I found and its working fine... the code is below...

    var $XMLStr = _readFile("test.xml");
    $XMLStr = $XMLStr.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, "");
    var $x = new XML($XMLStr);
    var $value=$x.Book[0].NAME.toString();
Sign In or Register to comment.