<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Custom Task Pane</title><link>https://www.infopathdev.com:443/forums/thread/12566.aspx</link><pubDate>Wed, 14 Sep 2005 03:48:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12566</guid><dc:creator>Mik</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12566.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12566</wfw:commentRss><description>I am currently setting up a context-sensitive task pane in one of my forms using Jscript.&lt;br /&gt;I have read and understood how to do this with div tags in the HTML and code on the On Context Change event (as per M$ lab 14)&lt;br /&gt;Thats all working fine, but its not exactly what i require.&lt;br /&gt;In my application of it, there is one help for one group, which may contain many groups.&lt;br /&gt;&lt;br /&gt;Here is the script in my form:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var helpString = null;&lt;br /&gt;&lt;br /&gt;function XDocument::OnContextChange(eventObj)&lt;br /&gt;{&lt;br /&gt;   if (eventObj.Type == "ContextNode")&lt;br /&gt;   {&lt;br /&gt;      // Retrieve task pane object&lt;br /&gt;      var oTaskPane = XDocument.View.Window.TaskPanes.Item(0);   &lt;br /&gt;&lt;br /&gt;      // Retrieve html object for task pane&lt;br /&gt;      var oHTMLDoc = oTaskPane.HTMLDocument.all;&lt;br /&gt;      &lt;br /&gt;      // Clear previous help topic from task pane&lt;br /&gt;      if (helpString)&lt;br /&gt;         oHTMLDoc.item(helpString).style.display="none";&lt;br /&gt;      &lt;br /&gt;      // Display DIV statement having same ID as the context node name&lt;br /&gt;      oHTMLDoc.item(eventObj.Context.nodeName).style.display="";&lt;br /&gt;         &lt;br /&gt;      // Keep record of string displayed, so can later be cleared&lt;br /&gt;      helpString=eventObj.Context.nodeName;&lt;br /&gt;            &lt;br /&gt;      return;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As I have worked out "eventObj.Context.nodeName" is the name of the node, which is referencing the id of the div statements in the html.&lt;br /&gt;I have set each of the groups up, so if I could get the XPATH expression of the node (instead of just the name) I could find its location and display that associated div content.&lt;br /&gt;&lt;br /&gt;Can anyone help me output the XPATH from eventObj.Context&lt;br /&gt;And then does anyone know how I could strip the first group off the front of that (which i assume would be relatively easy with string functions, but cant hurt to help)&lt;br /&gt;&lt;br /&gt;Thanks</description></item></channel></rss>