如何使用 XSL 将 XML 文件转换为 FO 文件?

发布于 2024-09-15 13:19:14 字数 832 浏览 2 评论 0原文

我需要使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长发绾君心 2024-09-22 13:19:14

你期望出去什么?一张桌子?或者你真的期望有一个图表吗?如果是后者,那么你会对 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文