Can't get XmlDocument.SelectNodes to retrieve any of my nodes?

前端 未结 4 1939
迷失自我
迷失自我 2020-12-28 08:09

I\'m trying to parse an XML document. The document in question is an AppxManifest file.

An example document looks like this:



        
4条回答
  •  一个人的身影
    2020-12-28 08:56

    Not in this particular case, but in general, if the namespace URN in the actual XML is not exactly the same as one used to add a namespace to a namespace manager (example: missing a trailing slash), and a prefix is specified in XPath, the query may return null.

    If namespace URN in the XML is not reliable, syntax

    "//*[local-name()='tag']" 
    

    will work.

提交回复
热议问题