xml - 将值附加到 XSLT 数组中
问题描述
如何从标签外部将数据添加到 xslt 数组中。
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:map="http://www.w3.org/2005/xpath-functions/map"
xmlns:array="http://www.w3.org/2005/xpath-functions/array" exclude-result-prefixes="#all"
version="3.0">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="input"/>
<xsl:variable name="newline" select="' '"/>
<xsl:template match="/" name="xsl:initial-template">
<xsl:variable name="input-as-map" select="parse-json($input)" as="map(*)"/>
<root>
<!-- storing all the PERSONNUMBER present in the ibop -->
<xsl:variable name="item-array" as="element()*">
<Item>A</Item>
<Item>A</Item>
<Item>A</Item>
<Item>b</Item>
</xsl:variable>
</root>
</xsl:template>
</xsl:stylesheet>
在这里,我在开头和结尾的变量中添加值<xsl:variable>
..
那么如何将值添加到item-array
基于name
属性(在变量标签之外)..
就像我们在其他程序中所做的那样……强调文字
解决方案
那么如何根据名称属性(在变量标签之外)将值添加到项目数组中。
你不能。所有 XSLT 变量都是不可变的。
如果您想要一个具有不同值的变量,请创建一个新变量。
推荐阅读
- linkedin - 如何在 Linkedin 上编辑我的专业?
- angular - Angular 6 ActivatedRoute 网址
- qt - Qt QML MapRoute 线路构造不是很好,闪烁
- php - 带有自定义查询的木材分页给了我 404
- c# - 使用 Microsoft.Office.Interop.Outlook 发送电子邮件;带图像附件
- android - Emojis Compat 不显示表情符号
- python - 如何通过另一个模型发出获取模型请求?
- c# - C# .net core 2.1 Authorization的异常处理
- git - 如何查看在新创建的目录中跟踪了哪些文件?
- javascript - Laravel Mix 版本在 js 中增加了对 scss 文件的引用