Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
たとえば、サブレベルに項目がないセクションを見つけるなど、いくつかの基準を満たした子がいない場合に親を見つけたいと思います。XPathで可能ですか?
子要素を持たない//section[not(item)]すべての要素を見つけるか、子孫要素を持たないすべての要素を見つけます。それはあなたが探しているものですか?そうでない場合は、XML入力サンプルと、探している要素のより詳細な説明を表示することを検討してください。sectionitem//section[not(descendant::item)]sectionitem
//section[not(item)]
section
item
//section[not(descendant::item)]