如何将 XML 转换为 XSL-FO
How to convert XML to XSL-FO
我创建了一个 XML 文件以将其转换为 XSL 格式对象。我的 XML 文件包含“list”作为根元素和“com.ecom”作为要填充的重复元素很多次。
我的 XML 文件格式如下:
<?xml version="1.0" encoding="UTF-8"?>
<list>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>12:00IST</hours>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>1:00PM</hours>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>10:00AM</hours>
<url>
<url-name>http://www.sample.com</url-name>
</url>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>2:00PM</hours>
</com.ecom.personal>
</personal>
</com.ecom>
</list>
我想将此 XML 文件转换为 XSL-FO 格式。请帮帮我...
最常见的方法是使用 XSLT 将您的 XML 转换为 XSL-FO 词汇表。在 StackExchange 中搜索带有 'xsl-fo' 标签的问题,您会发现一些 XML 的多个示例(有些比其他的更好)以及用于将 XML 转换为 XSL-FO 的 XSLT 样式表。您可以挖掘这些来解决部分问题 and/or 您可以查看网络上的一些参考资料。
教程和示例:
- "Developing XSL-FO Stylesheets",天线屋,http://www.antennahouse.com/antenna1/xml-to-xsl-fo-stylesheets/
- "Comprehensive XSL-FO Tutorials and Samples Collection",天线屋,http://www.antennahouse.com/antenna1/comprehensive-xsl-fo-tutorials-and-samples-collection/
- "XSLT and XSL-FO Toolbox of Tips and Tricks",天线屋,http://www.mentea.net/resources/tips-and-tricks.pdf
- "Overview of XSL-FO", data2type, http://www.data2type.de/en/xml-xslt-xslfo/xsl-fo/#c108
- "Practical Formatting Using XSL-FO",Crane Softwrights,http://www.cranesoftwrights.com/training/index.htm#pfux
- "XSL Formatting Objects Tutorial", RenderX, http://www.renderx.com/tutorial.html
- "XSL-FO Tutorial", Ecrion, http://www.ecrion.com/help/products/xfrenderingserver/xfultrascalehelp3/xsl_fo_tutorial.htm
- Ibex PDF Creator 文档,Ibex,http://xmlpdf.com/documentation.html
在特定于 Ibex 的页面
中有一些教程,例如表格和 headers/footers
XSL-FO 快速参考
- "Mapping of elements to the permitted properties",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/els2prop.html
- "XSL-FO Shorthands, from 1.1 spec",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/shorthands.html
- "Properties and the FOs they apply to",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/prop2els.html
- "XSL 1.1 Properties",门茶,http://www.mentea.net/resources/xsl11-properties.pdf
我创建了一个 XML 文件以将其转换为 XSL 格式对象。我的 XML 文件包含“list”作为根元素和“com.ecom”作为要填充的重复元素很多次。
我的 XML 文件格式如下:
<?xml version="1.0" encoding="UTF-8"?>
<list>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>12:00IST</hours>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>1:00PM</hours>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>10:00AM</hours>
<url>
<url-name>http://www.sample.com</url-name>
</url>
</com.ecom.personal>
</personal>
</com.ecom>
<com.ecom>
<name>test123</name>
<countryCode>IND</countryCode>
<logo>test.jpg</logo>
<personal>
<com.ecom.personal>
<details>abcd</details>
<hours>2:00PM</hours>
</com.ecom.personal>
</personal>
</com.ecom>
</list>
我想将此 XML 文件转换为 XSL-FO 格式。请帮帮我...
最常见的方法是使用 XSLT 将您的 XML 转换为 XSL-FO 词汇表。在 StackExchange 中搜索带有 'xsl-fo' 标签的问题,您会发现一些 XML 的多个示例(有些比其他的更好)以及用于将 XML 转换为 XSL-FO 的 XSLT 样式表。您可以挖掘这些来解决部分问题 and/or 您可以查看网络上的一些参考资料。
教程和示例:
- "Developing XSL-FO Stylesheets",天线屋,http://www.antennahouse.com/antenna1/xml-to-xsl-fo-stylesheets/
- "Comprehensive XSL-FO Tutorials and Samples Collection",天线屋,http://www.antennahouse.com/antenna1/comprehensive-xsl-fo-tutorials-and-samples-collection/
- "XSLT and XSL-FO Toolbox of Tips and Tricks",天线屋,http://www.mentea.net/resources/tips-and-tricks.pdf
- "Overview of XSL-FO", data2type, http://www.data2type.de/en/xml-xslt-xslfo/xsl-fo/#c108
- "Practical Formatting Using XSL-FO",Crane Softwrights,http://www.cranesoftwrights.com/training/index.htm#pfux
- "XSL Formatting Objects Tutorial", RenderX, http://www.renderx.com/tutorial.html
- "XSL-FO Tutorial", Ecrion, http://www.ecrion.com/help/products/xfrenderingserver/xfultrascalehelp3/xsl_fo_tutorial.htm
- Ibex PDF Creator 文档,Ibex,http://xmlpdf.com/documentation.html 在特定于 Ibex 的页面 中有一些教程,例如表格和 headers/footers
XSL-FO 快速参考
- "Mapping of elements to the permitted properties",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/els2prop.html
- "XSL-FO Shorthands, from 1.1 spec",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/shorthands.html
- "Properties and the FOs they apply to",戴夫·鲍森,http://www.dpawson.co.uk/xsl/sect3/prop2els.html
- "XSL 1.1 Properties",门茶,http://www.mentea.net/resources/xsl11-properties.pdf