<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Populate fields based on test to XML resource file</title><link>https://www.infopathdev.com:443/forums/thread/7923.aspx</link><pubDate>Wed, 12 Oct 2005 16:33:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7923</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7923.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7923</wfw:commentRss><description>Why don't you implement the onAfterChange() event (on Pay# control) to populate the necessary after the Pay# field has been changed? It would look something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function msoxd_my_PayNumber::OnAfterChange(eventObj)&lt;br /&gt;{&lt;br /&gt;	var payNum = Math.parseInteger(eventObj.Site.text);&lt;br /&gt;&lt;br /&gt;	var date = secondary_data_source_DOM.selectSingleNode( "\\ns:date[ns:PayNum = " + payNum + "]" );&lt;br /&gt;	var settle = secondary_data_source_DOM.selectSingleNode( "\\ns:date[ns:PayNum = " + payNum + "]" );&lt;br /&gt;&lt;br /&gt;	XDocument.DOM.selectSingleNode( "\\my:date" ).text = date;&lt;br /&gt;	XDocument.DOM.selectSingleNode( "\\my:settlementPeriod" ).text = settle;&lt;br /&gt;}&lt;/pre&gt;How did you create your XML secondary data source? It looks like you have &amp;lt;Date&amp;gt; nodes with several attributes, instead of sub-nodes. Is this correct XML format? If it is, it doesn't seem very effecient. You should structure your XML more like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;Date&amp;gt;&lt;br /&gt;	&amp;lt;PayNum&amp;gt;22&amp;lt;/PayNum&amp;gt;&lt;br /&gt;	&amp;lt;Weekending&amp;gt;21/10/05&amp;lt;/Weekending&amp;gt;&lt;br /&gt;	&amp;lt;StlPer&amp;gt;1&amp;lt;StlPer&amp;gt;&lt;br /&gt;&amp;lt;/Date&amp;gt;&lt;/pre&gt;Hope this helps....&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;</description></item><item><title>Populate fields based on test to XML resource file</title><link>https://www.infopathdev.com:443/forums/thread/4991.aspx</link><pubDate>Wed, 12 Oct 2005 14:46:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4991</guid><dc:creator>bslaght</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4991.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4991</wfw:commentRss><description>Basically I have three fields:&lt;br /&gt;1. Pay #&lt;br /&gt;2. Date&lt;br /&gt;3. Settlement Period&lt;br /&gt;&lt;br /&gt;I want to populate the Date and Settlement Period fieds depending on what is entered into the Pay # fields, and I want to get that data from an XML Document (secondary data source - resource file) based on a test of whether the Pay # exist in the XML Doc.&lt;br /&gt;&lt;br /&gt;So here is a snippet of my XML doc.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;br /&gt;&amp;lt;Dates&amp;gt;&lt;br /&gt;     &amp;lt;Date PayNum="22" Weekending="21/10/05" StlPer="1" /&amp;gt;&lt;br /&gt;     &amp;lt;Date PayNum="23" Weekending="04/11/05" StlPer="2" /&amp;gt;&lt;br /&gt;     &amp;lt;Date PayNum="24" Weekending="18/11/05" StlPer="1" /&amp;gt;&lt;br /&gt;     &amp;lt;Date PayNum="25" Weekending="02/12/05" StlPer="2" /&amp;gt;&lt;br /&gt;     &lt;br /&gt;&amp;lt;/Dates&amp;gt;&lt;br /&gt;&lt;br /&gt;So I want my code to look at what was entered into the Pay # box, chekc and see if that Pay # exist in the XML doc in the PayNum attribute, then populate the Date box with the corresponding Weekending attribute and populate the settlement period box with the corresponding StlPer attribute.&lt;br /&gt;&lt;br /&gt;Thoughts, ideas?  I see this as being being some sort of current()test against the PayNum, but I just can't get my head around it.&lt;br /&gt;&lt;br /&gt;Thanks for your continued support.</description></item></channel></rss>