xslt - 如何通过 xsl 模板将字体和样式应用于 xml 数据
问题描述
我正在尝试修改 xsl 代码以将一些字体大小和颜色应用于它产生的内容,但没有取得多大成功。
这是我的示例 xml 数据格式
<xml>
<Node1 attribute1="Test1" attribute2="Test2" attribute3="Test3"></Node1>
</xml>
这是我拥有的当前 xsl 模板:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:jscript="http://www.url.com">
<xsl:apply-templates select="//Node1"></xsl:apply-templates>
<xsl:template match="Node1">
Value# 1 = <xsl:value-of select="@attribute1"/>
Value# 2 = <xsl:value-of select="@attribute2"/>
Value# 3 = <xsl:value-of select="@attribute3"/>
</xsl:template>
</xsl:stylesheet>
我想显示内容
Value #1 = Test1
Value #2 = Test2
Value #3 = Test3
在内容上带有一些字体样式和颜色。有人可以提供一些例子我该怎么做?谢谢
解决方案
推荐阅读
- java - 我可以在 scala 项目中生成临时 java 代码吗
- laravel - 在 Eloquent 中查询相关表中的多行
- javascript - 在 React Js 的多用户仪表板中遇到路由问题
- javascript - 如何在 javascript 中读取远程文本文件
- git - Pandoc 基本 HTTP 身份验证
- r - 结合 R 管道工和 RAppArmor
- php - Laravel Artisan 命令:在某处存储值,但在数据库中经常运行命令
- html - 如何在同一行上对齐中心的标题和右侧的图标并且是响应式的
- curl - 使用 WGET 或 CURL 或类似方法将 foo 附加到文件名?
- android - 带有“时间”类型的 EditText 在三星设备中不显示冒号