我有以下rtf模板,我正在尝试使用。
<?choose:?>
<?when: COMP_3_COMPENSATION_AMOUNT='' and COMP COMP_2_COMPENSATION_AMOUNT='' ?>
No Letter has been generated for this employee as they were not eligible for a pay or bonus review and did not receive any share awards.
Plan: <?PLAN_NAME?>
Period: <?PERIOD_NAME?>
Name: <?NAME?>
Person Number: <?PERSON_NUMBER?>
<?end when?>
<?otherwise:?>
<?NAME?>
Person Number : <?PERSON_NUMBER?>
<?CURRENT_JOB?>
Dear <?FIRST_NAME?>,
<?IF: COMP_4_COMPENSATION_AMOUNT=''?>
Pay Review 2016
On this occasion you have not been awarded a salary increase. Your salary will remain at £ <? BASE_SALARY_CURRENT?> per annum.
<?end if?>
<?IF: COMP_4_COMPENSATION_AMOUNT!=''?>
Pay Review 2016
I am pleased to advise you that your salary will be increased to £ <?BASE_SALARY_NEW?> from 1st Jan 2016.
<?end if?>
<?IF: COMP_2_ELIGIBILITY_STATUS='N' OR COMP_PERF_RATING_DESCR= ‘Unsatisfactory’ COMP_PERF_RATING_DESCR?> = ' '?>
Annual Bonus 2016
On this occasion you have not been awarded a bonus.
<?end if?>
<?IF: COMP_2_ELIGIBILITY_STATUS='Y' AND COMP_PERF_RATING_DESCR != ' Unsatisfactory'?>
Annual Bonus 2016
You have been awarded a Annual bonus of £<?COMP_2_COMPENSATION_AMOUNT?>. This will be paid during 1st Feb 2016.
A number of factors have been taken into account to determine your final bonus including; performance against objectives, overall company performance and target bonus %.
<?end if?>
At Xyz we have always been committed to ensuring that our pay is competitive and we pay our employees appropriately for the role that they do.
Congratulations and best wishes for 2017.
Yours sincerely
<?PRIMARY_MANAGER?>
<?end otherwise?>
<?end choose?>
<? split-by-page-break:?><?end for-each?>
但是当我验证它时,我收到以下错误。标签似乎没问题。尝试了一切仍然得到同样的错误
[082816_215752750][][ERROR] [Line 2006.6] Incorrect XPath: COMP_3_COMPENSATION_AMOUNT='' and COMP COMP_2_COMPENSATION_AMOUNT=''
[082816_215752790][][ERROR] [Line 2069.34] Incorrect XPath: COMP_2_ELIGIBILITY_STATUS='N' OR COMP_PERF_RATING_DESCR= ‘Unsatisfactory’ COMP_PERF_RATING_DESCR
[082816_215752798][][ERROR] [Line 2086.166] Incorrect XPath: COMP_2_ELIGIBILITY_STATUS='Y' AND COMP_PERF_RATING_DESCR != ' Unsatisfactory'
问题似乎与null标签有关。有人可以告诉我,如果表达式为null,或者我在上述模板中做错了其他任何事情,我们怎么写?
答案 0 :(得分:0)
试试这个
<?choose:?>
<?when:COMP_3_COMPENSATION_AMOUNT='' and COMP_2_COMPENSATION_AMOUNT='' ?>
No Letter has been generated for this employee as they were not eligible for a pay or bonus review and did not receive any share awards.
Plan: <?PLAN_NAME?>
Period: <?PERIOD_NAME?>
Name: <?NAME?>
Person Number: <?PERSON_NUMBER?>
<?end when?>
<?otherwise:?>
<?NAME?>
Person Number : <?PERSON_NUMBER?>
<?CURRENT_JOB?>
Dear <?FIRST_NAME?>,
<?if: COMP_4_COMPENSATION_AMOUNT=''?>
Pay Review 2016
On this occasion you have not been awarded a salary increase. Your salary will remain at £ <?BASE_SALARY_CURRENT?> per annum.
<?end if?>
<?if: COMP_4_COMPENSATION_AMOUNT!=''?>
Pay Review 2016
I am pleased to advise you that your salary will be increased to £ <?BASE_SALARY_NEW?> from 1st Jan 2016.
<?end if?>
<?if: COMP_2_ELIGIBILITY_STATUS = 'N' or COMP_PERF_RATING_DESCR ='Unsatisfactory' or COMP_PERF_RATING_DESCR = ''?>
Annual Bonus 2016
On this occasion you have not been awarded a bonus.
<?end if?>
<?if:COMP_2_ELIGIBILITY_STATUS='Y' and COMP_PERF_RATING_DESCR != 'Unsatisfactory'?>
Annual Bonus 2016
You have been awarded a Annual bonus of £<?COMP_2_COMPENSATION_AMOUNT?>. This will be paid during 1st Feb 2016.
A number of factors have been taken into account to determine your final bonus including; performance against objectives, overall company performance and target bonus %.
<?end if?>
At Xyz we have always been committed to ensuring that our pay is competitive and we pay our employees appropriately for the role that they do.
Congratulations and best wishes for 2017.
Yours sincerely
<?PRIMARY_MANAGER?>
<?end otherwise?>
<?end choose?>
<? split-by-page-break:?>
存在一些语法问题,额外和缺少标记。我认为AND和OR运算符区分大小写。上面的代码通过验证。