Drop the curly braces, i.e. use test="count(employmentNav/EmpEmployment/compInfoNav/EmpCompensation/startDate) >= count(employmentNav/EmpEmployment/jobInfoNav/EmpJob/startDate)"
. I also think you need xsl:choose/xsl:when test/xsl:otherwise
instead of a single xsl:if
if you really need to execute two different branches of code.
As you have tagged your question for XSLT 2.0 and XSLT 3.0 it might be possible to solve things at the XPath expression level with the if (conditional expression) then expression1 else expression2
expression e.g.
if (count(employmentNav/EmpEmployment/compInfoNav/EmpCompensation/startDate) >= count(employmentNav/EmpEmployment/jobInfoNav/EmpJob/startDate)) then mf:foo() else mf:bar()
where mf:foo
and mf:bar
would be user-defined functions set up with xsl:function
.
The whole description with talk about loops sounds as if you try to use procedural programming with XSLT, you might want to show us small but representative samples of XML input, output you want together with the rules you want to implement so that we might be able to suggest a more XSLT like approach.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…