I have successfully used TinyXpath with root node as below
const char* xpath ="/MyRoot/A/B";
TinyXpath::xpath_processor xp_proc(mRootElement, xpath);
(this will find all B under all A of MyRoot)
I wonder if I can pass non-root element to the constructor something like below
const char* xpath = "./A/B";
TinyXpath::xpath_processor xp_proc(A_Element, xpath);
(I want to find all B under specific A, when I have A_Element)
Thank you
Given this constructor definition from the TinyXPath documentation:
You could have:
provided that
A_Element
is of typeTiXmlNode*
This will select all
B
elements that are children of anA
element that is a child of the element referenced byA_Element
.In case you want to select all
B
elements that are children of the element referenced byA_Element
, then the call should be: