728x90
반응형

 

name2fo.xsl

<?xml version="1.0" encoding="utf-8"?>

<name>Frank</name>

 

name.xml

<?xml version="1.0" encoding="utf-8"?>

           <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">

           <xsl:output method="xml" indent="yes"/>

           <xsl:template match="/">

                     <fo:root>

                                <fo:layout-master-set>

                                          <fo:simple-page-master master-name="A4-portrait" page-height="29.7cm" page-width="21.0cm" margin="2cm">

                                                     <fo:region-body/>

                                          </fo:simple-page-master>

                                </fo:layout-master-set>

                                <fo:page-sequence master-reference="A4-portrait">

                                          <fo:flow flow-name="xsl-region-body">

                                                     <fo:block>

                                                     Hello, <xsl:value-of select="name"/>!

                                                     </fo:block>

                                          </fo:flow>

                                </fo:page-sequence>

                     </fo:root>

           </xsl:template>

</xsl:stylesheet>

 

generate.cmd

@REM  Apache FOP (ver 1.0/1.1)

c:\FOP\fop -xml name.xml -xsl name2fo.xsl -pdf name.pdf

 

 

728x90
반응형

+ Recent posts