+ Start a Discussion
kito kidkito kid 

can't get value of ELEMET on xml with DOM

Below is the xml.

 

<item>
<title>
<![CDATA[ TESTING ]]>
</title>
<guid isPermaLink="false">https://www.test.com</guid>
<link>https://www.test.com/16</link>
</item>

 

I am using the followin code, but I couldn't get value of title.

In this case, I want TESTING insides title.

 

if(node.getName() == 'Item'){
       String data = node.getChildElement('title', null).getText()

}

Best Answer chosen by Admin (Salesforce Developers)