Skip to main content
1-Visitor
June 22, 2013
Question

Two Simple XPATH questions

  • June 22, 2013
  • 12 replies
  • 2474 views

<tag1>


<tag2></tag2>


</tag1>



If I'm in tag2, how do I access tag1? I tried ../tag1[1] and parent[1]



And also, how would I access the first element from an att with XPATH? For example, this didn't work:



<e-i-c gi="code" occur="all">
...
<att>


<specval attname="code[1]" attloc="#xpath" attval="1"/">
<charsubset>...</charsubset>
</att>
</e-i-c>



    12 replies

    1-Visitor
    June 24, 2013
    Hi Caroline,

    On further reflection, I'm thinking the problem may be that the e-i-cs are not in the correct order and are not being matched properly. If occur=all is listed first, it will always be used and other occurrences will be ignored. (This may be my least favorite thing about Styler.)

    Good luck!
    Suzanne


    cleccese1-VisitorAuthor
    1-Visitor
    June 25, 2013

    Thanks Suzanne. I added in a last context and now it's working fine. Sheesh!