I am able to read xml using XmlReader, but not able to read xml's CDATA portion.
How to read it ?
Below is my code
private void ParseDataValueNode(XmlReader CmdNode, Message Msg)
{
int DataValueNodeCount = 0;
while (CmdNode.Read())
{
if (CmdNode.Name.Equals("DataValue") && CmdNode.NodeType == XmlNodeType.Element)
{
DataValueNodeCount++;
ParseDataValueNode(CmdNode, Msg, DataValueNodeCount, true);
}
}
}
XML
<Response Id="2">
<Information>
<![CDATA[ <DataValue Name="abc" Value="dddd"/> <DataValue Name="ccc" Value="ffff"/> <DataValue Name="ddd" Value="dfdf"/> ]]>
</Information>
</Response>
If xml doesn't contain CDATA then it works perfectly fine, however in case CDATA it doesn't read elements under CDATA