Absolute path of context node - InfoPath Dev
in

InfoPath Dev

Absolute path of context node

Last post 11-22-2005 09:48 AM by franck. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-21-2005 10:37 PM

    Absolute path of context node

    Hi,

    While handling OnContextChange() event, i want to get absolute path of context node (context node could be element or an attribute). or atleast owner element for selected attribute..

    Can any one post some script/code for implementing this..?

    Thanks,
    E. Rajasekar.
  • 11-21-2005 11:10 PM In reply to

    Re: Absolute path of context node

    Hi,

    Use something around:
    bool b = true;
    string sTemp = oNode.nodeName;
    while (b)
    {
    oNode = oNode.parentNode;
    if (oNode != null)
    {sTemp = oNode.nodeName + "/" + sTemp;}
    else
    {b=false;}
    }

    Regards,

    Franck Dauché
    InfoPathDev
  • 11-21-2005 11:58 PM In reply to

    Re: Absolute path of context node

    Thanks a lot!.

    It works fine if context node is an element. But not if it is attribute. oNode.parentNode returns null for attribute..

    Can you just tell me how do I get element owner of an attribute..?

    Thanks,
    E. Rajasekar.
  • 11-22-2005 02:45 AM In reply to

    Re: Absolute path of context node

    Finaly I got answer from google...

    attrNode.selectSingleNode("..") returns element node..

    Thanks,
    E. Rajasekar
  • 11-22-2005 09:48 AM In reply to

    Re: Absolute path of context node

    Great. Glad it is working...

    Franck
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.