xml文件的节点名有冒号(:)时如何定位?
用下面的写法出错
SelectSingleNode("ns0:Query/ns0:Filter");
因为里面有冒号:
怎么办??????
xml文档如下:
<ns0:Query xmlns:ns0="http://schemas.microsoft.com/[OracleDb://ocoracle/]">
<ns0:Filter(to_char(riqi,'yyyy-mm-dd')>='2008-08-01')</ns0:Filter>
<ns0:MaxRows>100000</ns0:MaxRows>
</ns0:Query>
--------------------编程问答-------------------- 参考这个:
private void DocumentSelectNodes()
{
if (this.XMLSchemaReferences.Count > 0)
{
string XPath = "/x:catalog/x:book/x:title";
object key = 1;
string PrefixMapping = "xmlns:x=\"" +
this.XMLSchemaReferences.get_Item(ref key).NamespaceURI +
"\"";
Word.XMLNodes nodes = this.SelectNodes(XPath,
PrefixMapping, true);
}
else
{
MessageBox.Show("The document does not contain a " +
"schema reference.");
}
}
--------------------编程问答-------------------- 那个叫做命名空间
参考下
操作带有命名空间的XML --------------------编程问答-------------------- 命名空间啊
哈哈,冒号 :)
补充:.NET技术 , C#