Note: I can only find objects using the string inside <desc> , that is, I find all the elements that have <desc> and then read the text inside them one by one and compare it with a dictionary.
If the mapping is done, I have to change the sibling element..
Now I need to find the sibling in one of the following two ways: 1- Finding parent and finding sibling through him 2- Finding sibling directly
I think my problem is that I can get everything by getting the first element xpath. If the element was among the selected objects, I could easily get its xpath in the loop(iterItems). But here no object is selected and my code is responsible for intelligently finding objects.
Sorry if it's a bit long. hope it is not complicated
I find an element by the following code:
This element has brothers and sisters who do not have special characteristics to identify them and can only be recognized by their tags.
<g id="shape875-64" v:mID="875" v:groupContext="shape" transform="translate(43.0197,-65.2966)">
<title>Sheet.875</title>
<desc>ML_OP1</desc>
<v:textBlock v:margins="rect(1,1,1,1)" v:tabSpace="42.5197" v:verticalAlign="0"/>
<v:textRect cx="39.685" cy="243.262" width="79.38" height="17.0079"/>
<rect x="0" y="234.758" width="79.3701" height="17.0079" class="st9"/>
<text x="15.47" y="248.36" class="st11" v:langID="1033">ML_OP1</text>
</g>
Here I need last sibling <text>.
Note: I can only find objects using the string inside <desc> , that is, I find all the elements that have <desc> and then read the text inside them one by one and compare it with a dictionary.
If the mapping is done, I have to change the sibling element..
Now I need to find the sibling in one of the following two ways:
1- Finding parent and finding sibling through him
2- Finding sibling directly
I think my problem is that I can get everything by getting the first element xpath. If the element was among the selected objects, I could easily get its xpath in the loop(iterItems). But here no object is selected and my code is responsible for intelligently finding objects.
Sorry if it's a bit long. hope it is not complicated