0
votes

The Error I am observing is

cvc-complex-type.2.4.a: Invalid content was found starting with element 'xsl:output'. One of '{"http://www.w3.org/1999/XSL/Transform":param, "http://www.w3.org/1999/ XSL/Transform":variable, "http://www.w3.org/1999/XSL/Transform":instruction, "http://www.w3.org/1999/XSL/Transform":literal-result-element, WC[##other:"http:// www.w3.org/1999/XSL/Transform"], WC[""]}' is expected.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:java="http://xml.apache.org/xalan/java"
    xmlns:fib="com.genpact.pvai.service.CodeListComponent"
    xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
    <xsl:import href="C.5.xsl" />
    <xsl:template match="MCCI_IN200100UV01/PORR_IN049016UV">
        <xsl:output encoding="UTF-8" indent="yes" method="xml"
            standalone="no" omit-xml-declaration="no" />

        <xsl:for-each
            select="controlActProcess[@classCode='CACT'][@moodCode='EVN']/subject[@typeCode='SUBJ'][1]/investigationEvent[@classCode='INVSTG'][@moodCode='EVN']/reference[@typeCode='REFR'][document/code[@code='2'][@codeSystem='2.16.840.1.113883.3.989.2.1.1.27']]">
            <fo:table table-layout="fixed" width="100%" font-size="9pt"
                border-color="black" border-width="0.2mm" border-style="solid"
                text-align="center" display-align="center" space-after="5mm">
                <fo:table-column
                    column-width="proportional-column-width(100)" />
                <fo:table-column
                    column-width="proportional-column-width(100)" />
                <fo:table-column
                    column-width="proportional-column-width(100)" />
                <fo:table-column
                    column-width="proportional-column-width(100)" />


                <fo:table-body font-size="95%">
                    <fo:table-row>
                        <fo:table-cell border-width="0.2mm"
                            border-style="solid" border-color="black"
                            number-columns-spanned="4" font-size="11pt" space-after="0mm">
                            <fo:block font-weight="bold" text-align="center"
                                background-color="#FFA07A">
                                Literature Reference -
                                <xsl:value-of select="position()" />
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                    <fo:table-row>
                        <fo:table-cell border-width="0.2mm"
                            border-style="solid" border-color="black" display-align="center">
                            <fo:block color="blue" text-align="left">Literature
                                Reference
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border-width="0.2mm"
                            border-style="solid" border-color="black" display-align="center">
                            <fo:block>
                                <xsl:choose>
                                    <xsl:when
                                        test="document[@classCode='DOC'][@moodCode='EVN']/bibliographicDesignationText/@nullFlavor">
                                        <xsl:value-of
                                            select="document[@classCode='DOC'][@moodCode='EVN']/bibliographicDesignationText/@nullFlavor" />
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:value-of
                                            select="document[@classCode='DOC'][@moodCode='EVN']/bibliographicDesignationText/text()" />
                                    </xsl:otherwise>
                                </xsl:choose>
                            </fo:block>
                        </fo:table-cell>

                        <fo:table-cell border-width="0.2mm"
                            border-style="solid" border-color="black" display-align="center">
                            <fo:block color="blue" text-align="left">Included Document
                            </fo:block>
                        </fo:table-cell>
                        <fo:table-cell border-width="0.2mm"
                            border-style="solid" border-color="black" display-align="center">
                            <fo:block>
                                <xsl:value-of
                                    select="document[@classCode='DOC'][@moodCode='EVN']/text/text()" />
                            </fo:block>
                        </fo:table-cell>
                    </fo:table-row>
                </fo:table-body>
            </fo:table>
        </xsl:for-each>
        <xsl:apply-imports />
    </xsl:template>
</xsl:stylesheet>
1

1 Answers

0
votes

From the XSLT 1.0 specification:

The xsl:output element is only allowed as a top-level element.

It must be a child of xsl:stylesheet, outside of any template.