我想查找 objects xmlns="http://www.springframework.net" 这个节点,请问C#中如何实现。现在有如何节点:
<configuration>
<spring>
<context>
........
</context> <objects xmlns="http://www.springframework.net" >
<object name>.....</object>
......
</objects>
</spring>
</configuration>
docAppConfig.SelectSingleNode("configuration/spring/objects") 这个方式不行啊,对于带有xmlns的如何查找呢?在线等待高手解答。
<configuration>
<spring>
<context>
........
</context> <objects xmlns="http://www.springframework.net" >
<object name>.....</object>
......
</objects>
</spring>
</configuration>
docAppConfig.SelectSingleNode("configuration/spring/objects") 这个方式不行啊,对于带有xmlns的如何查找呢?在线等待高手解答。
XmlNamespaceManager xnm = new XmlNamespaceManager(doc.NameTable);
xnm.AddNamespace("xxx", "http://www.springframework.net"); XmlNode node = doc.SelectSingleNode("/configuration/spring/xxx:objects/xxx:object", xnm);