示例#1
0
        public void Should_Return_complex_remove_all_Local_Variable_from_List_when_InputBinding_contains_a_xpath_formula_contains_local_var()
        {
            var xml =
                @"<pd:inputBindings xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"">           
 <inputs>
                <xsl:variable name=""params"">
                    <xsl:for-each select=""$Start/pfx3:logInfo/param"">
                        <xsl:if test=""name !='xml'"">
                            <xsl:value-of select=""concat(' [', name, '=', value, ']')""/>
                        </xsl:if>
                    </xsl:for-each>
                    <xsl:if test=""exists($Start/pfx3:logInfo/param[name='xml'])"">
                        <xsl:value-of select=""concat('&#xA;&#x9;', translate($Start/pfx3:logInfo/param[name='xml']/value, '&#xA;', ''))""/>
                    </xsl:if>
                </xsl:variable>
                
                     <Interface>
                        <xsl:value-of select=""Start/pfx3:logInfo/GetProcessInstanceInfo[1]/ProcessStarterName""/>
                    </Interface>
                     </inputs>
</pd:inputBindings>
";
            XElement doc           = XElement.Parse(xml);
            var      inputBindings = doc.Nodes();
            var      variableNames = new XpathUtils().GetVariableNames(inputBindings);

            Assert.AreEqual(1, variableNames.Count);
            Assert.AreEqual("start_logInfo", variableNames.FirstOrDefault());
        }
示例#2
0
        public void Should_Return_all_Local_Variable_from_List_when_InputBinding_contains_a_xpath_formula_contains_local_var()
        {
            var xml =
                @"<pd:inputBindings xmlns:pd=""http://xmlns.tibco.com/bw/process/2003"" xmlns:xsl=""http://w3.org/1999/XSL/Transform"">           
    <Log>      
        <xsl:variable name=""messageBody"" select=""tib:render-xml($Start/pfx3:logInfo, true(), true())""/>            
        <Message>
            <xsl:value-of select=""concat($Start/pfx3:logInfo, true(), $params,' ')""/>
        </Message>
    </Log>
</pd:inputBindings>
";
            XElement doc           = XElement.Parse(xml);
            var      inputBindings = doc.Nodes();
            var      variableNames = new XpathUtils().GetAllLocalVariables(inputBindings);

            Assert.AreEqual(1, variableNames.Count);
            Assert.AreEqual("messageBody", variableNames.FirstOrDefault());
        }