1

I am trying to read attribute value which is within a CDATA from XML in Talend. I am getting the value along with CDATA and not the value alone. My XML format is :

<root>
   <node attribute="![CDATA[value]]" />
</root>

In Xpath if i give attribute it is retrieving the value as ![CDATA[value]]. I want to get only "value". Is it possible to get the value inside the CDATA?

  • it seems that you can't have CDATA inside an attribute. see http://stackoverflow.com/questions/1289524/is-it-possible-to-have-html-text-or-cdata-inside-an-xml-attribute – Corentin Feb 14 '17 at 13:35

1 Answers1

1

tMap or tJavaFlex set output value as:

row1.value.replaceAll("!\\[CDATA\\[","").replaceAll("\\]\\]","")

row1.value - change for You real name

a_vlad
  • 261
  • 3
  • 8