You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Viktoria Harila <vi...@improve.se> on 2000/11/21 09:55:52 UTC

blocks

Hello everybody!

I´ve just started to work with XSL-FO and I´ve got a little problem that
needs to be solved.

I have two elements, paragrafnr and paragraftext,  My problem is that I need
to give them different properties and I´d like them both on the same row
within my document. Paragrafnr needs to be bold and paragraftext (stycke)
needs to be normal but indented. 
If I put them within the same fo:block element they will get the same
properties, I´ve tried to create a fo:inline and this will give the two
elements different properties, but they still don´t end up on the same row
in the document.

Does anybody know how this is done? 

Thank you!

/ Viktoria Harila
viktoria.harila@improve.se


This is what my code look like now.

<xsl:template match="paragraf">
	<fo:block font-family="serif" font-size="12pt"
space-before.optimum="3pt" space-after.optimum="3pt">
	<fo:inline-sequence font-weight="bold">§<xsl:value-of
select="@paragrafnr"/></fo:inline-sequence>
	<xsl:apply-templates/></fo:block>
	</xsl:template>

<xsl:template match="stycke">
	<xsl:choose>
	   <xsl:when test="parent::paragraf">
		<xsl:apply-templates/>
	   </xsl:when>
	   <xsl:otherwise>
		<fo:block font-size="12pt" font-family="serif"
space-after.optimum="3pt">
		<xsl:apply-templates/></fo:block>
	   </xsl:otherwise>
	</xsl:choose>
</xsl:template>

Re: blocks

Posted by Fotis Jannidis <fo...@lrz.uni-muenchen.de>.
You could use a list and put the content of Paragrafnr into  fo:list-
item-label and the other into fo:list-item-body.
Or you could use tables.
see docs/examples/fo for examples.

Fotis

> Hello everybody!
> 
> I´ve just started to work with XSL-FO and I´ve got a little problem that
> needs to be solved.
> 
> I have two elements, paragrafnr and paragraftext,  My problem is that I need
> to give them different properties and I´d like them both on the same row
> within my document. Paragrafnr needs to be bold and paragraftext (stycke)
> needs to be normal but indented. 
> If I put them within the same fo:block element they will get the same
> properties, I´ve tried to create a fo:inline and this will give the two
> elements different properties, but they still don´t end up on the same row
> in the document.
> 
> Does anybody know how this is done? 
> 
> Thank you!
> 
> / Viktoria Harila
> viktoria.harila@improve.se
> 
> 
> This is what my code look like now.
> 
> <xsl:template match="paragraf">
> 	<fo:block font-family="serif" font-size="12pt"
> space-before.optimum="3pt" space-after.optimum="3pt">
> 	<fo:inline-sequence font-weight="bold">§<xsl:value-of
> select="@paragrafnr"/></fo:inline-sequence>
> 	<xsl:apply-templates/></fo:block>
> 	</xsl:template>
> 
> <xsl:template match="stycke">
> 	<xsl:choose>
> 	   <xsl:when test="parent::paragraf">
> 		<xsl:apply-templates/>
> 	   </xsl:when>
> 	   <xsl:otherwise>
> 		<fo:block font-size="12pt" font-family="serif"
> space-after.optimum="3pt">
> 		<xsl:apply-templates/></fo:block>
> 	   </xsl:otherwise>
> 	</xsl:choose>
> </xsl:template>