SAP ABAP实用技巧介绍系列之 ABAP XSLT copy keyword
生活随笔
收集整理的這篇文章主要介紹了
SAP ABAP实用技巧介绍系列之 ABAP XSLT copy keyword
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Created by Jerry Wang on Jun 30, 2014
用于測(cè)試的xml:
<catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Hide your heart</title> <artist>Bonnie Tyler</artist> <country>UK</country> <company>CBS Records</company> <price>9.90</price> <year>1988</year> </cd> </catalog>下列xslt將只會(huì)輸出h2的My CD Collection,因?yàn)閟ub template 匹配之后沒有任何實(shí)現(xiàn):
但是如果sub template未匹配成功,例如指定了一個(gè)錯(cuò)誤的path:
添加copy keyword可以讓匹配的node加入到輸出中:
<xsl:template match="/catalog/cd"> <p>hel</p><xsl:copy><xsl:apply-templates/></xsl:copy> </xsl:template> </xsl:stylesheet>輸出:
刪除copy keyword只保留apply-templates效果相同:
使用copy將每個(gè)cd node重復(fù)輸出三次:
總結(jié)
以上是生活随笔為你收集整理的SAP ABAP实用技巧介绍系列之 ABAP XSLT copy keyword的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 常用的免费好用的DNS有哪些?
- 下一篇: SAP ABAP实用技巧介绍系列之 AB