C
C#2y ago
2fur

How to read CData from the xml?

Hello, I have this code to read a xml from the web, but I dont know how to get the cdata with it. Can anyone help, please?
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
Console.Write("<" + reader.Name);

while (reader.MoveToNextAttribute())
Console.Write(" " + reader.Name + "='" + reader.Value + "'");
Console.Write(">");
Console.WriteLine(">");
break;
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
case XmlNodeType.EndElement:
Console.Write("</" + reader.Name);
Console.WriteLine(">");
break;
}
}
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
Console.Write("<" + reader.Name);

while (reader.MoveToNextAttribute())
Console.Write(" " + reader.Name + "='" + reader.Value + "'");
Console.Write(">");
Console.WriteLine(">");
break;
case XmlNodeType.Text:
Console.WriteLine(reader.Value);
break;
case XmlNodeType.EndElement:
Console.Write("</" + reader.Name);
Console.WriteLine(">");
break;
}
}
3 Replies
Anton
Anton2y ago
cdata?
2fur
2furOP2y ago
Ohh, thank u Thats what im looking 4
Want results from more Discord servers?
Add your server