Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
<figure><title></title>
<subfig><graphic></graphic><subfig>
<subfig><graphic></graphic><subfig>
<subfig><graphic></graphic><subfig>
</figure>
If I am in subfig #2, and I want to access an attribute (graphsty) of the graphic in subfig #1, would this do? (I am only interested in the graphic immediately preceding the subfig I am in.)
preceding-sibling::subfig[1]/graphic[1][@graphsty] or
preceding-sibling[1]/graphic[1][@graphsty] ?
and if I was in a graphic I would access the previous graphic by
../preceding-sibling::subfig[1]/graphic[1][@graphsty]?
Thanks Brandon!
So this is what they should be?
preceding-sibling::subfig[1]/graphic[1][/@graphsty] from <subfig>
../preceding-sibling::subfig[1]/graphic[1][/@graphsty] from <graphic>
From graphic in subfig, I want to check the graphsty att of the graphic in the preceding subfig. I test full-sheet.yn in subfig, but my results are off. The first time the variable should switch from y to n or vice versa there's a delay in my results. Is my logic wrong? If I do ../preceding-sibling::subfig[1]/graphic[1][/@graphsty] I only get 'y' values.
<graphic in=" subfig="> (graphsty=1 means a half-sheet graphic)
<att>
<specval attname="../preceding-sibling::subfig[1]/graphic[1][@graphsty]"<br"/>attloc="#xpath" attval="1"/>
<charsubset>
<savetext textid="full-sheet.yn" conrule="\n"/">
</charsubset>
</att>
<att>
<specval attname="../preceding-sibling::subfig[1]/graphic[1][@graphsty]"<br"/>attloc="#xpath" attval="0"/>
<charsubset>
<savetext textid="full-sheet.yn" conrule="\y"/"></charsubset>
</att>
test results from <subfig>:
<graphic>full-sheet=y (correct but irrelevant)
<graphic>full-sheet=y (correct)
<graphic graphsty="1">full-sheet=y (correct)
<graphic graphsty="1">full-sheet=n (incorrect)
<graphic graphsty="1">full-sheet=n (correct)
<graphic>full-sheet=n (correct)
<graphic>full-sheet=n (incorrect)
<graphic>full-sheet=y (correct)
<graphic>full-sheet=y (correct)
Ahh, never mind. preceding-sibling::subfig[1]/graphic[1][@graphsty] works if I set full-sheet.yn in <subfig> instead of <graphic> in <subfig>.
Arg. If I'm in a following-sibling of figure and I want to get to the preceding graphic, which could be in a subfig or figure, would this do?
preceding-sibling::*/graphic[1][@graphsty] or
preceding-sibling::*[1]/graphic[1][@graphsty]
I don't think that's right.
Thank you, Gareth!