<?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>event error null element</title><link>https://www.infopathdev.com:443/forums/thread/12765.aspx</link><pubDate>Fri, 03 Feb 2006 12:55:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12765</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12765.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12765</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;What I try to make is a selectsinglenode with a condition in a secondary datasource.&lt;br /&gt;&lt;br /&gt;Hier is my code:&lt;br /&gt;&lt;pre&gt;[InfoPathEventHandler(MatchPath="/AV/AVel/M/choix", EventType=InfoPathEventType.OnAfterChange)]&lt;br /&gt;public void choix_OnAfterChange(DataDOMEvent e)&lt;br /&gt;{&lt;br /&gt;	//sélection du muster pour le remplissage&lt;br /&gt;	if (e.IsUndoRedo)&lt;br /&gt;	{&lt;br /&gt;	return;}&lt;br /&gt;	if (e.Source.nodeType != DOMNodeType.NODE_TEXT)&lt;br /&gt;	{&lt;br /&gt;	return;}&lt;br /&gt;	if(e.Site != e.Parent)&lt;br /&gt;	{&lt;br /&gt;	return;}&lt;br /&gt;        if ("Insert" != e.Operation)&lt;br /&gt;        {&lt;br /&gt;          return;}&lt;br /&gt;//Sélection du noeud a remplacer et récup de l'id &lt;br /&gt;IXMLDOMNode Old = e.Source.parentNode.parentNode.selectSingleNode("Muster");&lt;br /&gt;&lt;br /&gt;string Choicetext = e.Source.text;&lt;br /&gt;string condition = "/dfs:myFields/dfs:dataFields/tns:getMusterParamsResponse/tns:getMusterParamsResult/tabMuster/Modele[Des = '" + Choicetext + "']/Muster";&lt;br /&gt;&lt;br /&gt;//Recherche du bon modele a l'aide de l'id		&lt;br /&gt;IXMLDOMDocument2 oDomSearch = (IXMLDOMDocument2)thisXDocument.GetDOM("getMusterParams");&lt;br /&gt;oDomSearch.setProperty("SelectionNamespaces", "xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"&lt;br /&gt;xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" xmlns:tns=\"http://zefix.powernet.ch/WebServices\"");&lt;br /&gt;&lt;br /&gt;IXMLDOMNode New = oDomSearch.selectSingleNode(condition);&lt;/pre&gt; &lt;br /&gt;&lt;br /&gt;Choice is a dropdown listebox populate by the same datasource so infopath must find this entry!&lt;br /&gt;&lt;br /&gt;The problem is that this listebox is in a repeating section and if it's not the first occurence(if first occurence that always work) that dont work anymore: new is null (for all entry)!&lt;br /&gt;&lt;br /&gt;my XPath (string condition) for example is: "/dfs:myFields/dfs:dataFields/tns:getMusterParamsResponse/tns:getMusterParamsResult/tabMuster/Modele[Des = 'Bes. befähigter Revisor, Hinterlegung Unterlagen']/Muster" and that send null (I have seen in the secondary ds he is present)&lt;br /&gt;&lt;br /&gt;Any idea about what is going wrong?&lt;br /&gt;&lt;br /&gt;I'm totally lost!&lt;br /&gt;&lt;br /&gt;Thierry</description></item></channel></rss>