天天看点

SAP ABAP实用技巧介绍系列之 template的match顺序

用于测试的xml:

Empire Burlesque

Bob Dylan

USA

Columbia

10.90

1985

Hide your heart

Bonnie Tyler

UK

CBS Records

9.90

1988

step1: 整个document 被匹配,输出My CD Collection ( 被蓝色标识出来)

SAP ABAP实用技巧介绍系列之 template的match顺序
step2:

My CD Collection

添加到输出,开始执行 < xsl:apply-templates/>:

step3: 从debugger callstack观察到line 7的apply-templates 会trigger /catalog/cd/title node的匹配,进入line 14 p node:

step4: 输出p node的内容(line 16 )

callstack:

step5: title node的匹配完成,继续剩下的document 输出:

callstack从line 16 返回到line 0: