xml - How to get the nearest ancestor node based on multiple value -


how nearest ancestor based on multiple choice nodes ?

mean: let's assume have lot of tags in xml file : chapter, section, subsection, subsubsection, abstract , others. let's assume on node on level , want see node nearest me based 1 choices have (chapter,section,subsection,subsubsection).

you can use ancestor::*[self::chapter | self:section | self::subsection | self::subsubsection][1].

if want name use name(ancestor::*[self::chapter | self:section | self::subsection | self::subsubsection][1]).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -