简体   繁体   English

为什么不能将 xsl:value-of 放入 fo:block 中?

[英]Why is it not OK to put a xsl:value-of into a fo:block?

I have the following XSL file:我有以下 XSL 文件:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output media-type="text" omit-xml-declaration="yes"/>

    <xsl:template match="root/branch">

        <fo:root>

            <fo:layout-master-set>
                <fo:simple-page-master master-name="simple"
                                       page-height="29.7cm"
                                       page-width="21cm"
                                       margin-top="1cm"
                                       margin-bottom="2cm"
                                       margin-left="2.5cm"
                                       margin-right="2.5cm">
                    <fo:region-body margin-top="3cm"/>
                    <fo:region-before extent="3cm"/>
                    <fo:region-after extent="1.5cm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="simple">
                <fo:flow flow-name="xsl-region-body">

                    <fo:block font-size="12pt"
                              font-family="sans-serif"
                              line-height="15pt"
                              space-after.optimum="3pt"
                              text-align="justify">
                        <xsl:value-of select="branch/greenLeave"/>
                        <xsl:value-of select="branch/yellowLeave"/>
                    </fo:block>

                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>
</xsl:stylesheet>

When I open it in IDEA IntelliJ, I get the following error message:当我在 IDEA IntelliJ 中打开它时,我收到以下错误消息: IntelliJ 中的错误消息

Does anybody know what is wrong here?有人知道这里有什么问题吗? I cannot find a plausible explanation.我找不到合理的解释。

Seems like the XSD for FOP which I downloaded from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd lacked support for nested XSL-T statements. Seems like the XSD for FOP which I downloaded from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd lacked support for nested XSL-T statements.

As a workaround, I manually added a作为一种解决方法,我手动添加了一个

<any processContent="skip"/>

to that XSD file at the right place.到正确位置的那个 XSD 文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的Python程序在IntelliJ中得到UnicodeDecodeError,但是从命令行可以吗? - Why does my Python program get UnicodeDecodeError in IntelliJ but is OK from the command line? 为什么 Intellij 显示编译时问题,即使 maven 没问题 - why Intellij is showing compile time issue, even-though maven is OK 为什么相同的scala代码在命令行中运行正常而不在Intellij中? - Why does the same scala code work OK in command line while not in Intellij? 在 Intellij IDEA 生成的 kotlin 原生项目中放置 gradle 依赖项块的位置? - Where to put gradle dependencies block in kotlin native project generated by Intellij IDEA? 为什么IntelliJ不能正确格式化此代码块? - Why doesn't IntelliJ properly format this block of code? 为什么IntelliJ将注释标题放在错误的位置...仅用于测试? - Why does IntelliJ put comment headers in the wrong place … for tests only? 为什么我这里不能成功调用 .put 方法? - Why can't I successfully call the .put method here? (JAVA) 为什么我需要将 com.company 放在我的程序的开头,这段代码是如何工作的? - (JAVA) Why do I need to put com.company at the start of my program and how does this code work? 无法使用 Intellij 中的 Play 2 Framework 解析方法“ok(?)” - Cannot resolve method 'ok(?)' with Play 2 Framework in Intellij 无法识别Java 8 Lambda,但配置正常 - Cannot recognize java 8 lambda but the configuration is ok
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM