Subject: Re: Working example xml+xsl to .fo file
From: eleonora46@xxxxxxx
Date: Tue, 18 Nov 2008 19:25:48 +0100
|
Martin,
Thanks a million, that works, great help!
-eleonora
-------- Original-Nachricht --------
> Datum: Tue, 18 Nov 2008 19:16:27 +0100
> Von: Martin Honnen <Martin.Honnen@xxxxxx>
> An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Betreff: 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>
> <fo:layout-master-set>
> <fo:simple-page-master master-name="LetterPage"
> page-width="8.5in"
> page-height="11in" >
> <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>
> </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>
> <fo:layout-master-set>
> <fo:simple-page-master master-name="LetterPage"
> page-width="8.5in"
> page-height="11in" >
> <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>
>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> --
>
> Martin Honnen
> http://JavaScript.FAQTs.com/
--
Psssst! Schon vom neuen GMX MultiMessenger gehvrt? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
|