XmlNode Value vs InnerText

后端 未结 5 2034
梦毁少年i
梦毁少年i 2020-12-08 18:03

I\'m creating a ping application for school with an XML full of URLs. I lost an hour because of XmlNode.Value was resulting in a null.

Then I changed i

5条回答
  •  伪装坚强ぢ
    2020-12-08 18:40

    The XML specification is very picky about terminology and what constitutes what type of XML object. As mentioned, element doesn't have a value. This is specific to attribute (and probably a couple of other node types) because attribute has a syntax that element does not, i.e. name='value'.

    If you think that's confusing, check out the difference between child and descendant, or the Root Node and the Document Element!

提交回复
热议问题