[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Working example xml+xsl to .fo file
eleonora46@xxxxxxx wrote:
No, that is just a working .fo file. I have such sample files in fop package. I need the way from xml+xsl to .fo file. Well write a stylesheet that creates an XSL-FO document as its result: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:template match="/"> <fo:root>B <fo:layout-master-set>B <fo:simple-page-master master-name="LetterPage" page-width="8.5in" page-height="11in" >B <fo:region-body region-name="PageBody" margin="0.7in"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="LetterPage"> <fo:flow flow-name="PageBody"> <fo:block>Hello World</fo:block> B </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> In a real stylesheet you would obviously fill the XSL-FO document with data from an XML document but as a Hello Word example the above suffices, it creates the without taking any data from the XML input. If you want a Hello world example for that then use e.g <foo>bar</foo> as the XML input document and then change the stylesheet to <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:template match="/"> <fo:root>B <fo:layout-master-set>B <fo:simple-page-master master-name="LetterPage" page-width="8.5in" page-height="11in" >B <fo:region-body region-name="PageBody" margin="0.7in"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="LetterPage"> <fo:flow flow-name="PageBody"> <fo:block>Hello World <xsl:value-of select="foo"/></fo:block> B </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://JavaScript.FAQTs.com/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|