Forum Discussion

thinker's avatar
thinker
Occasional Contributor
9 years ago

[Ready Api 1.3] xmholder getTextContent hit error: DOM level 3 not implemented

Hi,

 

I am using xmlHolder to hold the response xml and tried to read the values.    I am able to read the value from getNodeValues,  But I got problem if use getNodeValue return null and getTextContent hit error: DOM level 3 not implemented.

Any hint or suggestions are welcome.  Thanks in advance.

 

The response XML:

 

   <soap:Body>
      <searchForProductsResponse >
         <out>
            <ns1:ProductVO >
              <initialAmount>199900</initialAmount>
            </ns1:ProductVO>
         </out>
      </searchForProductsResponse>
   </soap:Body>
</soap:Envelope>

 

 

def holder = new XmlHolder (messageExchange.responseContentAsXml)


def node = holder.getNodeValues("//ns2:searchForProductsResponse[1]/ns2:out[1]/ns1:ProductVO[1]/ns1:initialAmount[1]")


def productVONodes1 = holder.getDomNodes("//ns1:ProductVO")


use (groovy.xml.dom.DOMCategory) {
    for( node1 in productVONodes1) {
        node1.children().each { child ->
            log.info child.getNodeValue()  // return null
            log.info child.getNodeName() // return initialAmount
            if ('initialAmount'.equals(child.getNodeName())){
                log.info child.getTextContent() // hit error : DOM level 3 not implemented
                }
        }
    }
}

 

No RepliesBe the first to reply