将 XSL:FO 中的行转换为列
尝试创建一个将行转换为列的表,以便我可以对 XML 中的列进行逻辑分组。 XML 是这样的:
<root>
<field name="field1">
<string>field1.row1</string>
<string>field1.row2</string>
<string>field1.row3</string>
<string>field1.row4</string>
</field>
<field name="field2">
<string>field2.row1</string>
<string>field2.row2</string>
<string>field2.row3</string>
<string>field2.row4</string>
</field>
<field name="field3">
<string>field3.row1</string>
<string>field3.row2</string>
<string>field3.row3</string>
<string>field3.row4</string>
</field>
</root>
这意味着每个字段都有许多单元格,全部显示在一列中,并且字段不是跨列,而是显示在多行中。
我尝试创建一些 xsl(无济于事)来将此信息显示为水平分组表。
关于如何做到这一点有什么想法吗?
Trying to create a table where rows are turned into columns so that I can logically group the columns in XML.
The XML s something like this:
<root>
<field name="field1">
<string>field1.row1</string>
<string>field1.row2</string>
<string>field1.row3</string>
<string>field1.row4</string>
</field>
<field name="field2">
<string>field2.row1</string>
<string>field2.row2</string>
<string>field2.row3</string>
<string>field2.row4</string>
</field>
<field name="field3">
<string>field3.row1</string>
<string>field3.row2</string>
<string>field3.row3</string>
<string>field3.row4</string>
</field>
</root>
This means every field has numerous cells all displayed in a column, and instead of the field spanning columns, it is displayed over several rows.
I have tried to create some xsl (to no avail) to display this information as a horizontally grouped table.
Any ideas on how this could be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该样式表生成一个简单的 XSL-FO 表。它将
field
元素转换为列,将string
元素转换为行:从示例 XML 生成的输出:
This stylesheet produces a simple XSL-FO table. It turns the
field
elements into columns, and thestring
elements into rows:Output generated from the sample XML: