<?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>Re: How to traverse from an errors object to its parent node (using C#)?</title><link>https://www.infopathdev.com:443/forums/thread/59419.aspx</link><pubDate>Wed, 29 Sep 2010 13:44:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59419</guid><dc:creator>Alf Kiil</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59419.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59419</wfw:commentRss><description>&lt;p&gt;Hi guys,&lt;/p&gt;
&lt;p&gt;It works.&lt;/p&gt;
&lt;p&gt;By the way.&amp;nbsp;In my particular case,&amp;nbsp;I was looking for the top&amp;nbsp;level nodes where the names of the nodes varies (i.e. they don&amp;#39;t always start&amp;nbsp;with &amp;quot;my:CompanyTable&amp;quot;). The solution that works for me is simply: &lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;string topNode = err.Site.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;../..&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).LocalName.ToString();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to traverse from an errors object to its parent node (using C#)?</title><link>https://www.infopathdev.com:443/forums/thread/59272.aspx</link><pubDate>Fri, 24 Sep 2010 15:30:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59272</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59272.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59272</wfw:commentRss><description>&lt;p&gt;Hi Alf,&lt;/p&gt;
&lt;p&gt;Site is just an XPathNavigator node, so you treat it like any other and use 
&lt;strong&gt;Site.SelectSingleNode(&amp;quot;..&amp;quot;); &lt;/strong&gt;to get the parent node. Or if you 
know that your XML structure is always going to start with a node named 
&amp;quot;my:CompanyTable&amp;quot; then you can traverse back using 
&lt;strong&gt;Site.SelectSingleNode(&amp;quot;ancestor::my:CompanyTable/..&amp;quot;).LocalName&lt;/strong&gt; 
to access the group node name.&lt;/p&gt;</description></item><item><title>Re: How to traverse from an errors object to its parent node (using C#)?</title><link>https://www.infopathdev.com:443/forums/thread/59252.aspx</link><pubDate>Fri, 24 Sep 2010 08:28:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59252</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59252.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59252</wfw:commentRss><description>&lt;p&gt;Hi Alf Kiil,&lt;/p&gt;
&lt;p&gt;We implemented this several years ago and have a working sample for both rich client and browser forms. I will ask one of our developers to respond to your specific question tomorrow. &lt;/p&gt;
&lt;p&gt;More soon,&lt;/p&gt;</description></item><item><title>How to traverse from an errors object to its parent node (using C#)?</title><link>https://www.infopathdev.com:443/forums/thread/59208.aspx</link><pubDate>Thu, 23 Sep 2010 11:09:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:59208</guid><dc:creator>Alf Kiil</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/59208.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=59208</wfw:commentRss><description>&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;I am trying to implement an “errors page” (a separate view) in InfoPath browser-enabled forms, because users often find it difficult to locate errors in multiple view&amp;nbsp;&amp;nbsp;and complex forms. An errors page may also facilitate more and better information/links to resources/guidance on errors than mouse over info allows for.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;I am extensively using referenced groups/fields, where a repeating group may be used in different views but for different purposes/to allow for a different functionality, as illustrated below.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; 
&lt;p&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;em&gt;&lt;strong&gt;VIEW 1&lt;/strong&gt; (used for the applicant company):&lt;br /&gt;&lt;/em&gt;&amp;lt;my:CompanyGroup&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;my:CompanyTable&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyId&amp;gt;&amp;lt;/my:CompanyId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyName&amp;gt;&amp;lt;/my:CompanyName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyAddress&amp;gt;&amp;lt;/my:CompanyAddress&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyZip&amp;gt;&amp;lt;/my:CompanyZip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; … etc&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;lt;/my:CompanyTable&amp;gt;&lt;br /&gt;&amp;lt;/my:CompanyGroup&amp;gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;em&gt;&lt;strong&gt;VIEW2&lt;/strong&gt; (used for partner companies):&lt;/em&gt;&lt;br /&gt;&amp;lt;my:CompanyGroup2&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;my:CompanyTable&amp;gt; &lt;em&gt;(reference repeating group of CompanyTable above)&lt;/em&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyId&amp;gt;&amp;lt;/my:CompanyId&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyName&amp;gt;&amp;lt;/my:CompanyName&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyAddress&amp;gt;&amp;lt;/my:CompanyAddress&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;my:CompanyZip&amp;gt;&amp;lt;/my:CompanyZip&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; … etc&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;lt;/my:CompanyTable&amp;gt;&lt;br /&gt;&amp;lt;/my:CompanyGroup2&amp;gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="mso-ansi-language:EN-US;"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;I&amp;nbsp;use the FormError properties to locate the errors, and display them in an errors list on the errors page, where I also want to indicate the particular view where the error occurs. However, these properties (Site.LocalName, Site.OuterXml.ToString) only allows me to identify the immediate node, and not the parent node (example: err.Site.LocalName on an error in CompanyZip only identifies the node name “CompanyZip”). Because the same node may occur in different referenced groups in different views, I am not able to guide the user&amp;nbsp;to which view the error occurs (is it in View 1 or View 2?). So my question is, how do I traverse from the particular error object (e.g. CompanyZip) to its parent (first to CompanyTable, then to CompanyGroup)?&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>