You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Bruno Sanz Marino <br...@inicia.es> on 2003/10/30 22:01:13 UTC

html class attribute like

Hi

I´m writing some kind of xsl templates to write "fo" files from html and
i have some dudes with the css stylesheets.

Can a Use some kind of "template" like the css "class" attribute to define
some styles for "blocks" and "inline" text?

Thank you in advance

Bruno

NUEVO TISCALI ADSL ON
¡Navega desde las 15.00h. a alta velocidad por sólo 29,50 €/mes!
Conócelo en http://acceso.tiscali.es/pag-acceso-adsl-on.jsp?did=adn-7520007






---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: How to preserve newline?

Posted by "Manjush G. Menon" <ma...@lycos.co.uk>.
Thanks Christian,

but the requirement i have is like follws:
I will create the XML on the fly, from some user input fields.
so the character replacement will not hold. also, the same XML is streamed
back to the user in HTML. seperate <block> cannot be used as the XML node
is mapped in the HTML in one single node.

So what i was looking for is an explicit way to say that "I want to preserve
space for
my node". Hope you got me :-)

Thanks for the help
~~Manjush

----- Original Message -----
From: "Christian Geisert" <ch...@isu-gmbh.de>
To: <fo...@xml.apache.org>
Sent: Thursday, November 06, 2003 5:54 PM
Subject: Re: How to preserve newline?


> Manjush G. Menon wrote:
> > I have an XML data with several paragraphs with newlines.
> > but the generated PDF doesnt preserve it.
> > How will i do it?
>
> http://xml.apache.org/fop/fo.html#fo-preformat
>
> or wrap each paragraph in an extra <block>
>
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: How to preserve newline?

Posted by Christian Geisert <ch...@isu-gmbh.de>.
Manjush G. Menon wrote:
> I have an XML data with several paragraphs with newlines.
> but the generated PDF doesnt preserve it.
> How will i do it?

http://xml.apache.org/fop/fo.html#fo-preformat

or wrap each paragraph in an extra <block>

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


How to preserve newline?

Posted by "Manjush G. Menon" <ma...@lycos.co.uk>.
I have an XML data with several paragraphs with newlines.
but the generated PDF doesnt preserve it.
How will i do it?

any help will be of great use.

Thanks
~~Manjush

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: html class attribute like

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Andreas L. Delmelle wrote:
> BTW: Do you know if there are any other advantages to using attribute-sets?

They can be overridden when imported, the spec has an example.

> I guess, what I mean is: if they are both defined in a stylesheet
> external to the one used to construct the FO, would one of the two be faster
> or more efficient in some way?

I don't think performance is an issue one way or another. The
attributes bundled with attribute-set end up as attributes in
the result, just as if you added them individually.

J.Pietschmann



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: html class attribute like

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: J.Pietschmann [mailto:j3322ptm@yahoo.de]
>
> Andreas L. Delmelle wrote:
> > Yup! ( a little off-topic for the list, but here's a starter... )
>
> Even better, there is an obscure feature called xsl:attribute-set
                           ^^^^^^^^^^^^^^
Joerg,

If I weren't so used to your 'style' by now, I'd probably be convinced that
it actually *is* an obscure feature :)

Never mind... Thx a million for this one ( will come in handy, that's for
sure ).

BTW: Do you know if there are any other advantages to using attribute-sets?
( apart from being able to use them for either fo:block or fo:inline, for
instance ) I guess, what I mean is: if they are both defined in a stylesheet
external to the one used to construct the FO, would one of the two be faster
or more efficient in some way?

TIA!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Re: html class attribute like

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Andreas L. Delmelle wrote:
> Yup! ( a little off-topic for the list, but here's a starter... )

Even better, there is an obscure feature called xsl:attribute-set
  <xsl:attribute-set name="note-style">
     <xsl:attribute name="font-style">italic</xsl:attribute>
     <xsl:attribute name="font-family">Schoolbook</xsl:attribute>
  </xsl:attribute-set>
  <xsl:attribute-set name="small-font">
     <xsl:attribute name="font-size">80%</xsl:attribute>
  </xsl:attribute-set>
  ...
  <fo:block" xsl:use-attribute-sets="note-style small-font">
   ...

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


RE: html class attribute like

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Bruno Sanz Marino [mailto:brunosm@inicia.es]
>
> I´m writing some kind of xsl templates to write "fo" files from html and
> i have some dudes with the css stylesheets.
>
> Can a Use some kind of "template" like the css "class" attribute to define
> some styles for "blocks" and "inline" text?
>

Yup! ( a little off-topic for the list, but here's a starter... )

Example:

XML
<text>Text to be formatted.</text>

XSLT

This you can put in a separate template for inclusion in a number of other
XSLs
<xsl:template name="bodytext" >
  <xsl:param name="ptext" />

  <fo:block text-align="justify" font-size="11pt" font-weight="normal">
    <xsl:value-of select="$ptext" />
  </fo:block>
</xsl:template>

And, later on...

<xsl:call-template name="bodytext" >
  <xsl:with-param name="ptext" select="text" />
</xsl:call-template>


Hope this helps!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org