<?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>Qdabra qRules</title><link>https://www.infopathdev.com:443/forums/131.aspx</link><description>qRules adds support to your InfoPath  forms. With qRules, you can add features to your form that require code, but without having to write it. </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102403.aspx</link><pubDate>Tue, 05 May 2015 18:01:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102403</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102403.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102403</wfw:commentRss><description>&lt;p&gt;You bet - so, just in case you need some details (or in case someone else happens along this post and needs deets):&lt;/p&gt;
&lt;p&gt;The count of the preceding repeating node returns a number of 0 or more (if this is the first row, it has no preceding siblings, after all) and by adding 1 we get the index for the current row.&lt;/p&gt;
&lt;p&gt;In qRules, the Command node is just parsing the string we pass it and attempting to run the code requested. Using the concat statement, we are giving it an XPath to the correct Work Order row - like my:WorkOrder[2] or my:WorkOrder[5], etc. This way the code can select the right row.&lt;/p&gt;</description></item><item><title>Re: ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102402.aspx</link><pubDate>Tue, 05 May 2015 17:53:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102402</guid><dc:creator>jpthoma7</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102402.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102402</wfw:commentRss><description>It worked!   It is actually happening with any changes on the WO_TEXT field (assuming the WO_Text field has a |Q| or |1| token in it...I have another similar rule that checks for |1|).    Thank you so much!</description></item><item><title>Re: ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102401.aspx</link><pubDate>Tue, 05 May 2015 17:43:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102401</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102401.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102401</wfw:commentRss><description>&lt;p&gt;Try this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;concat(&amp;quot;ReplaceString /xpathsrc=/my:RCInspection/my:WorkOrders/my:WorkOrder[&amp;quot;,count(../preceding-sibling::my:WorkOrder) + 1,&amp;quot;]/my:WO_TEXT /string1=|Q| /string2=&amp;quot;, ../my:WOQty)&amp;quot;&lt;/p&gt;
&lt;p&gt;I forgot to ask where the rule is running - it looks like on a field inside of WorkOrder (based on the relative path to WOQty). If I&amp;#39;ve guessed wrong, you may have an issue with this XPath: ../preceding-sibling::my:WorkOrder&lt;/p&gt;
&lt;p&gt;So, if this doesn&amp;#39;t work, let me know what executes the rule. :)&lt;/p&gt;</description></item><item><title>Re: ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102400.aspx</link><pubDate>Tue, 05 May 2015 17:39:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102400</guid><dc:creator>jpthoma7</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102400.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102400</wfw:commentRss><description>Thanks, Hilary!&lt;p&gt;the full xpath is: /my:RCInspection/my:WorkOrders/my:WorkOrder/my:WO_TEXT&lt;/p&gt;</description></item><item><title>Re: ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102399.aspx</link><pubDate>Tue, 05 May 2015 17:33:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102399</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102399.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102399</wfw:commentRss><description>&lt;p&gt;Hi - You&amp;#39;ll need to use the full path to WO_TEXT and use a count of preceding-sibling to get the right one. Can you right click WO_TEXT in the data source task pane and select Copy XPath? Paste the full XPath into a reply and I can help you. &lt;/p&gt;</description></item><item><title>ReplaceText error</title><link>https://www.infopathdev.com:443/forums/thread/102397.aspx</link><pubDate>Tue, 05 May 2015 17:25:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:102397</guid><dc:creator>jpthoma7</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/102397.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=131&amp;PostID=102397</wfw:commentRss><description>Hello
&lt;p&gt;
I am getting the following error when trying to use the ReplaceText function.  I am sure it is because of my use of the current() function in my xpathsrc statement.
&lt;/p&gt;
Action: ReplaceString. Arguments: xpathsrc: current()/my:WO_TEXT string1: |1| string2: Stain &amp;amp; Varnish . Details: XsltContext is needed for this query because of an unknown function.. Stack: at MS.Internal.Xml.XPath.CompiledXpathExpr.UndefinedXsltContext.ResolveFunction(String prefix, String name, XPathResultType[] ArgTypes) at MS.Internal.Xml.XPath.FunctionQuery.SetXsltContext(XsltContext context) at MS.Internal.Xml.XPath.BaseAxisQuery.SetXsltContext(XsltContext context) at MS.Internal.Xml.XPath.CompiledXpathExpr.SetContext(IXmlNamespaceResolver nsResolver) at System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver) at System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath, IXmlNamespaceResolver resolver) at Qdabra.Tools.RulesLibrary.Commands.GetValidNode(XPathNavigator start, String xpath, String errorMessage) at Qdabra.Tools.RulesLibrary.ReplaceString.DoSingleReplace(String dsnamesrc, String xpathsrc, String string1, String string2, String pattern) at Qdabra.Tools.RulesLibrary.ReplaceString.Execute() at Qdabra.Tools.RulesLibrary.CommandStarter.Run() at Qdabra.Tools.RulesLibrary.Commands.RunCommand(Commands command) at Qdabra.Tools.RulesLibrary.Commands.ExecuteCommand()

&lt;p&gt;

My QRules command is &amp;quot; concat(&amp;quot;ReplaceString /xpathsrc=current()/my:WO_TEXT /string1=|Q| /string2=&amp;quot;, ../my:WOQty)&amp;quot;.  I am in a repeating table trying to replace a token (&amp;quot;|Q|&amp;quot;) in  the current row&amp;#39;s WO_Text with the value of the current row&amp;#39;s quantity. &lt;/p&gt;</description></item></channel></rss>