Have a heck of a time writing XPATH to parse this XML response.

Source data is (removed a bunch to save the innocent:

`<?xml version="1.0" encoding="UTF-8"?><env>

<ProcessResponse>              
    <message>                     
    <payLoad>                            
        <BillingXMLMessage>                                   
            <Envelop>SITEINFORESPONSE</Envelop>
                              <COMPONENT DATATYPE="FLDPARAMINFO" NAME="ACCOUNTINFO">                                          
                                      <FIELD DATATYPE="FLDSTRING" NAME="ServiceType">/service/ip</FIELD>
                                      <FIELD DATATYPE="FLDBOOLEAN" NAME="ReactivationFlag">false</FIELD>`'

XPATH statement is
/env/ProcessResponse/message/payLoad/BillingXMLMessage/COMPONENT[1]/FIELD[@NAME='ServiceType']

Which only gets me

Element='<FIELD DATATYPE="FLDSTRING" NAME="ServiceType">/service/ip</FIELD>'

I need to get down to /service/ip

Any ideas?

Add /text() to your query.

Worked like a charm. Thanks for the quick help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.