Created by Jerry Wang, last modified on Jun 26, 2014

用于测试的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>

在tcode strans创建的xslt program:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/"><html><body><h2>My CD Collection</h2><xsl:apply-templates/></body></html>
</xsl:template>
</xsl:stylesheet>

match = “/” 意为匹配整个xml document:
测试输出:

输出结果来自xslt里manual 指定的h2 tag 以及匹配的整个xml document中每个节点的value,但不包含节点名称本身。
如果把match = “/”替换成 match = “title”:

输出如下, 因此此时有两个匹配的title node。

match=“catalog”: 效果如/
match=“cd”: 效果如match = “title”
match=“artist”: 找不到匹配的document,输出为空:

但如果先匹配整个document,再匹配artist node则可成功:

输出如下:

match="/catalog/cd": 输出同match=“cd”
match="/catalog/cd/title": 输出同上
match="/catalog/cd/artist": 输出为空
match=“artist[parent::cd]”>: 输出为空
输入如下:
[外链图片转存失败(img-U8zlk8Ac-1562210924325)(https://user-images.githubusercontent.com/5669954/27290940-0274646e-550f-11e7-9d3c-f2417d434d58.png)]
输出:

match="*":
每个节点都会生成一个h2 node:

SAP ABAP实用技巧介绍系列之 ABAP XSLT match keyword相关推荐

  1. SAP ABAP实用技巧介绍系列之 ABAP内存管理学习

    Created by Jerry Wang, last modified on May 26, 2014 使用如下report 测试ABAP memory: REPORT ztest_export. ...

  2. SAP ABAP实用技巧介绍系列之 在xslt里call ABAP method

    Created by Jerry Wang, last modified on Jul 02, 2014 用于测试的xml: <catalog> <cd> <title& ...

  3. SAP ABAP实用技巧介绍系列之 使用XSLT替换xml中指定node的value

    Created by Jerry Wang, last modified on Jun 30, 2014 用于测试的xml: <catalog> <cd> <title& ...

  4. SAP ABAP实用技巧介绍系列之 ABAP XSLT 定义变量

    Created by Jerry Wang, last modified on Jul 01, 2014 下面的xslt 片段定义了两个变量: header变量的内容为一系列html tab,而col ...

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

    Created by Jerry Wang on Jun 26, 2014 用于测试的xml: <catalog> <cd> <title>Empire Burle ...

  6. SAP ABAP实用技巧介绍系列之 ABAP XSLT 使用attribute增加新的属性

    Created by Jerry Wang on Jul 01, 2014 用于测试的xml: <catalog> <cd> <title>Empire Burle ...

  7. SAP ABAP实用技巧介绍系列之 ABAP XSLT select keyword

    Created by Jerry Wang on Jun 27, 2014 用于测试的xml: <catalog> <cd> <title>Empire Burle ...

  8. SAP ABAP实用技巧介绍系列之 ABAP XSLT apply_template keyword

    Created by Jerry Wang on Jun 26, 2014 测试使用的xml: <catalog> <cd> <title>Empire Burle ...

  9. SAP ABAP实用技巧介绍系列之 ABAP XSLT copy keyword

    Created by Jerry Wang on Jun 30, 2014 用于测试的xml: <catalog> <cd> <title>Empire Burle ...

最新文章

  1. 设计数据库字段或者java中使用boolean型时需谨慎
  2. 【廖雪峰Python学习笔记】面向对象高级编程
  3. React-native 环境配置过程与搭建项目问题汇总
  4. $(document).ready(); $().ready(); $()
  5. CUDA 编程实例:计算点云法线
  6. mysql练习_创建库与列表、增加列表信息、列表查询(包含多列表查询)_月隐学python第23课
  7. Hibernate框架 简述
  8. python3 mysql库_Python3.7 MySQL 数据库连接
  9. 【python】Python的基本数据类型以及运算符的练习题
  10. NOI 2017 整数(线段树)
  11. Javascript-history.go()和history.back()的用法和区别
  12. 空间机器人建模与仿真报告
  13. 腾讯信鸽推送,部分手机不能接收到推送弹窗
  14. 目标跟踪算法研究综述
  15. 软硬件交互 - 扫码枪
  16. 最佳Android模拟器,你值得拥有
  17. 运维工程师高阶面试总结
  18. 康托尔连续统假设(CH)不成立
  19. 一点接入全网互通,企业上云就用它!
  20. Ring Buffer (circular Buffer)环形缓冲区简介

热门文章

  1. 《设计师要懂心理学》-第四章-人如何思考
  2. Sitemesh 3 的使用及配置
  3. python中那纠结的os.system()与空格处理
  4. CSS基础(part13)--浮动
  5. 第三次学JAVA再学不好就吃翔(part87)--Arrays工具类的asList方法
  6. Django(part6)--利用正则的组名进行关键字传参
  7. pandas基础(part2)--DataFrame
  8. 整理了90个Pandas案例,强烈建议收藏!
  9. SAP 电商云 Spartacus UI 路由事件监控
  10. SAP UI5 使用 Smart Control 的一个具体例子