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

bash - How do you programmatically add a bats test? -

android - alarm manager service starting every oncreate -

java - Getting exception in JDBC thin driver -