<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Validation on a list checking for duplicates - using preceding and following sibling - and translate.</title><link>https://www.infopathdev.com:443/forums/thread/70183.aspx</link><pubDate>Fri, 09 Sep 2011 16:32:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70183</guid><dc:creator>Catharine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70183.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=70183</wfw:commentRss><description>&lt;p&gt;That is brilliant THANK YOU.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;This works a treat.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Have a great weekend&lt;/p&gt;
&lt;p&gt;Catharine&lt;/p&gt;</description></item><item><title>Re: Validation on a list checking for duplicates - using preceding and following sibling - and translate.</title><link>https://www.infopathdev.com:443/forums/thread/70177.aspx</link><pubDate>Fri, 09 Sep 2011 14:40:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70177</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70177.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=70177</wfw:commentRss><description>&lt;p&gt;The problem here is that translate() will only be applied to the first preceding or following sibling, and the validation would only work if the duplicates were right next to each other.&lt;/p&gt;
&lt;p&gt;You can use eval() to apply a function across all nodes in a set, and it should work here.&amp;nbsp; Please try this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;translate(., &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;, &amp;quot;abcdefghijklmnopqrstuvwxyz&amp;quot;) = xdMath:Eval(preceding-sibling::my:Aliases | following-sibling::my:Aliases, &amp;quot;translate(., &amp;#39;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;#39;, &amp;#39;abcdefghijklmnopqrstuvwxyz&amp;#39;)&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Note that having the preceding-sibling::my:Aliases | following-sibling::my:Aliases like that allows you to combine this into one expression.&lt;/p&gt;</description></item><item><title>Validation on a list checking for duplicates - using preceding and following sibling - and translate.</title><link>https://www.infopathdev.com:443/forums/thread/70133.aspx</link><pubDate>Thu, 08 Sep 2011 13:53:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70133</guid><dc:creator>Catharine</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70133.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=70133</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am using InfoPath 2007.&lt;/p&gt;
&lt;p&gt;I have a form with a repleating field.&amp;nbsp; I have set up some validation to check for duplicates in the list. The field is called Aliases and the validation is...&lt;/p&gt;
&lt;p&gt;. = preceding-sibling::my:Aliases&lt;/p&gt;
&lt;p&gt;and &lt;/p&gt;
&lt;p&gt;. = following-sibling::my:Aliases&lt;/p&gt;
&lt;p&gt;This works brilliantly - thank you for previous blogs and posts which helped me get that right.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I am shredding the data to SQL where it is part of a primary key.&amp;nbsp;&amp;nbsp;In&amp;nbsp;SQL&amp;nbsp;a value &amp;quot;xyz&amp;quot;&amp;nbsp; is considered the same as &amp;quot;XYZ&amp;quot; so I need to do something to prevent those &amp;quot;duplicate&amp;quot; values.&lt;/p&gt;
&lt;p&gt;So I have added the following&amp;nbsp;&amp;nbsp;validation&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;font size="3" face="Calibri"&gt;translate(., &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;, &amp;quot;abcdefghijklmopqrstuvwxyz&amp;quot;) = translate(preceding-sibling::my:Aliases, &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;, &amp;quot;abcdefghijklmopqrstuvwxyz&amp;quot;)&lt;/font&gt;&lt;/p&gt;&lt;font size="3" face="Calibri"&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;and&amp;nbsp;&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;translate(., &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;, &amp;quot;abcdefghijklmopqrstuvwxyz&amp;quot;) = translate(following-sibling::my:Aliases, &amp;quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&amp;quot;, &amp;quot;abcdefghijklmopqrstuvwxyz&amp;quot;)&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;I thought this would do the trick, but this does not fire when values xyz and XYZ are put in the field.&amp;nbsp; &lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;Is this the correct thing to be doing?&amp;nbsp; Is there another way to achieve it.&amp;nbsp; Or do I have to move to code ? :(&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;Thank you&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;Catharine&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>