如何使用 XSL 将 XML 文件转换为 FO 文件?
我需要使用 xsl 将基本 xml 文件转换为 FO 文件。
xml 看起来像这样:
<?xml version="1.0"?>
<column-chart-stacked-full>
<title>Provincie Antwerpen</title>
<x-axis-title>Gasmeters</x-axis-title>
<y-axis-title>Verbruik</y-axis-title>
<clusters>
<cluster number="1">
<bar>
<value>210</value>
</bar>
<bar>
<value>20</value>
</bar>
</cluster>
<cluster number="2">
<bar>
<value>20</value>
</bar>
<bar>
<value>30</value>
</bar>
</cluster>
...
I need to tranform a basic xml file into a FO file using xsl.
The xml looks like this :
<?xml version="1.0"?>
<column-chart-stacked-full>
<title>Provincie Antwerpen</title>
<x-axis-title>Gasmeters</x-axis-title>
<y-axis-title>Verbruik</y-axis-title>
<clusters>
<cluster number="1">
<bar>
<value>210</value>
</bar>
<bar>
<value>20</value>
</bar>
</cluster>
<cluster number="2">
<bar>
<value>20</value>
</bar>
<bar>
<value>30</value>
</bar>
</cluster>
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你期望出去什么?一张桌子?或者你真的期望有一个图表吗?如果是后者,那么你会对 FO 感到失望,因为它无法产生类似的东西。 XSL-FO 是关于格式化文本的,而不是关于图形的;为此你需要别的东西。我想到了 SVG。
如果您只想将上面的内容转换为表格,那么我建议您通过 DocBook 来定位 XSL-FO 表。 XSL-FO 是相当低级的。 DocBook 的层次要高得多。借助 DocBook,您只需依赖从 DocBook 到 XSL-FO 已完成的所有工作,而无需自己担心。
What are you expecting to get out? A table? Or do you actually expect a diagram? If it is the latter, then you will be disappointed by FO, since it will not be able to produce anything like it. XSL-FO is about formatted text, not about graphics; for that you will need something else. SVG comes to mind.
If all you want is to turn the above into a table, then I suggest you target XSL-FO tables by going through DocBook. XSL-FO is pretty low-level. DocBook is much more high-level. With DocBook, you can just rely on all of the work that has been done to go from DocBook to XSL-FO, without having to worry about it yourself.