xsl:template-如何从右到左呈现页面



我有xsl:template,它当前正从left to right渲染,我希望从right to left渲染它。

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:report="http://caretalks.somecompanyname.com/IET/2007/12"
xmlns:Parse="com.somecompanyname.caretalks.util.StringParserUtils"
xmlns:Ext="com.somecompanyname.caretalks.util.XsltUtils"
exclude-result-prefixes="fo">

<xsl:template match="report:memberEngagementReport">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA" page-height="11in"
page-width="8.5in" margin-top="0.5cm" margin-bottom="0.5cm"
margin-right="0.5cm" margin-left="0.5cm"
writing-mode="{$writingMode}">
<fo:region-body margin-top="1cm" margin-bottom="2.6cm"
margin-right="1.5cm" margin-left="1.5cm"/>
<fo:region-before extent="0.5cm"/>
<fo:region-after extent="2.0cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
.
.
.
.
</xsl:template>
</xsl:stylesheet>

我在网上搜索了可能的解决方案,但找不到我需要的东西。

我能做些什么才能将其渲染为right to left

我还在寻找一种方法来为双方渲染它(LTR/RTL(并维护一个原始的XSL文件。

writing-mode是继承的,因此在fo:root上设置writing-mode="rl",使其应用于整个文档。看见https://www.w3.org/TR/xsl11/#writing-模式。

你似乎在使用FOP,所以如果你想让不同区域的内容有不同的写作模式,你不能使用from-page-master-region()从页面区域获得写作模式。但是,由于写入模式有一个变量,因此可以在每个fo:flowfo:static-content上设置writing-mode

最新更新