我正在尝试阅读以下文件(部分显示)
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd"
manifestVersion="1.0"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1"
xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2"
xmlns="urn:schemas-microsoft-com:asm.v2"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:xrml="urn:mpeg:mpeg21:2003:01-REL-R-NS"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity name="program.application" version="4.0.0.27077" publicKeyToken="8f99fe9fddfae125e" language="neutral" processorArchitecture="msil" xmlns="urn:schemas-microsoft-com:asm.v1" />
我有
Dim manifestFile As String = webClient.DownloadString(location)
Dim xdoc As New Xml.XmlDocument()
xdoc.LoadXml(manifestFile)
我努力了
xdoc.SelectSingleNode("//asmv1:assemblyIdentity")
xdoc.SelectSingleNode("//assemblyIdentity")
Dim nsSys As Xml.XmlNamespaceManager = New Xml.XmlNamespaceManager(xdoc.NameTable)
nsSys.AddNamespace("def", "urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd")
xdoc.SelectSingleNode("//asmv1:assemblyIdentity",ns)
xdoc.SelectSingleNode("//assemblyIdentity",ns)
xdoc.SelectSingleNode("//def:assemblyIdentity",ns)
全部返回Nothing
选择<assemblyIdentity>
节点的正确路径是什么?
注意我不能使用 LinqToXml
谢谢