xsl-fo / pdf: root element help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jklBruin
    New Member
    • May 2006
    • 2

    xsl-fo / pdf: root element help

    i'm trying to implement converting xsl-fo to pdf on a .Net page.

    i''m getting the error message:
    Root element must be root, not http://www.w3.org/1999/XSL/Transform:stylesheet


    here's the xsl i'm using.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <xsl:stylesheet
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
            xmlns:fo="http://www.w3.org/1999/XSL/Format"
            >
    
    <xsl:template match="/">
    
    <fo:root>
            <fo:layout-master-set>
                    <fo:simple-page-master
                            margin=".25in"
                            page-width="11in"
                            page-height="8.5in"
                            master-name="first"
                    >
                            <fo:region-before extent=".25in"/>
                            <fo:region-body margin-top=".25in"/>
                            <fo:region-after extent=".25in"/>
                    </fo:simple-page-master>
            </fo:layout-master-set>
    
            <fo:page-sequence master-name="first">
                    <fo:static-content flow-name="xsl-region-before">
                            <xsl:call-template name="header" />
                    </fo:static-content>
    
                    <fo:flow flow-name="xsl-region-body">
                            <fo:block>
                                    <fo:table space-after.optimum="1pt" width="8in">
                                            <fo:table-column column-width="5in"/>
                                            <fo:table-column column-width="3in"/>
                                            <fo:table-body>
                                                    <xsl:call-template name="content" />
                                            </fo:table-body>
                                    </fo:table>
                            </fo:block>
                    </fo:flow>
            </fo:page-sequence>
    
    </fo:root>
    </xsl:template>
    
    <xsl:template name="header" match="/">
            <fo:table-row>
                    <fo:table-cell>
                            <fo:block font-weight="bold">Heading 1</fo:block>
                    </fo:table-cell>
            </fo:table-row>
    </xsl:template>
    
    <xsl:template name="content" match="//department/employee">
            <fo:table-row>
                    <fo:table-cell>
                            <fo:block ><xsl:value-of select="." /></fo:block>
                    </fo:table-cell>
            </fo:table-row>
    </xsl:template>
    
    </xsl:stylesheet>

    any help is GREATLY appreciated. thanks all.
    Last edited by Dormilich; Jan 21 '09, 10:37 AM. Reason: added [code] tags
Working...