我相信这是可能的,但无法弄清楚语法.像这样的东西:
xmlNode.SelectNodes("//*[count(child::*) <= 1]")
但这不正确.
syntax xpath selectnodes
selectnodes ×1
syntax ×1
xpath ×1