Can you correct this code so that I can convert a node of XML into Text ?
instance to convert.
int I;
string strNODE;
XmlTextReader XTR = new XmlTextReader("D:\\BOTOLA_MyDocument_Projects\\My Documents\\Visual Studio 2005\\Projects\\cs_XML_World\\WA_XML\\JO.xml");
if (XTR.NodeType = XmlNodeType.Element || XTR.NodeType = XmlNodeType.Text).........etcIt says :
Error 1 Operator '||' cannot be applied to operands of type 'System.Xml.XmlNodeType' and 'System.Xml.XmlNodeType'
It appears "you cannot use operand || to connect string and XmlNodeType.
HELP. Conversion Help !
PLEASE
Thanks
crest dubuaPosted May 19, 2008, 3:06 PM
Thanks
Ryan AlfordPosted May 19, 2008, 2:55 PM
if (XTR.NodeType == XmlNodeType.Element || XTR.NodeType == XmlNodeType.Text)
cliff notes:
a = b - assigning the value of "b" to "a"
a == b - checking for equality.
basically, you were trying to assign the value of XmlNodeType.Element to XTR.NodeType instead of checking if XTR.NodeType is an XmlNodeType.Element