I am currently trying to parse xml file using java but while parsing i am unable to parse the tags present inside the CDATA section of any element tag. The whole data inside the CDATA section is being parsed as text while parsing using DOM or SAX.
please suggest any way without any hard coding.
<Evaluation>
<![CDATA[<evaluation>
<interview ratingtype="0"/>
<item description="Ability to communicate well with others verbally and in writing:" hasrating="True" hascomments="False" /> ............ </item>
</evaluation> ]]
</Evaluation>
CDATA sections are text nodes. So the parser is correct reading it as a single string. CDATA sections mean that the parser will not do any decoding of entities. You can read more about it in the specification.
If you want to treat the contents of a CDATA section as an XML document or fragment you need to do this manually - in other words: parse it separately.