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 Peter Hopfgartner <pe...@r3-gis.com> on 2009/12/18 12:11:49 UTC

Passing Formulas to FOP

Hello,

we would like to format chemical formulas with FOP. The formulas come 
from the XML file.
We tried to include the FO instructions in the XML file, like in the 
following

H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O

Anyway, the formatting does not survive the XSL processing. Checking 
with -foout, the relevant fragment becomes "H2O".

Does anybody have any hint how to pass the formatting instructions to 
the final FO file?

Regards,

Peter

-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgartner@r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com


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


Re: Passing Formulas to FOP

Posted by Gregory Buchenberger <gr...@eightfoldconsulting.com>.
Peter,

A good place for strictly XSLT, XSL, and XPath questions is the XSL
mailing list at http://www.mulberrytech.com/xsl/xsl-list/

I'm fairly new to this as well. There certainly is a bit of a curve.
Happy styling! 

Best Regards,

Gregory Buchenberger

On Fri, 2009-12-18 at 14:25 +0100, Peter Hopfgartner wrote:
> Works!
> 
> Probably I've outed myself as a complete XSL green horn.
> 
> Thank you,
> 
> Peter
> 
> Nedim Buke wrote:
> > Hello Peter,
> >
> > As follows:
> >
> >   <!--SUP-->
> >    <xsl:attribute-set name="sup">
> >        <xsl:attribute name="font-size">smaller</xsl:
> >
> >     attribute>
> >            <xsl:attribute name="baseline-shift">super</xsl:attribute>
> >            <xsl:attribute name="vertical-align">super</xsl:attribute>
> >            <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
> >            <xsl:attribute name="keep-together">always</xsl:attribute>
> >        </xsl:attribute-set>
> >        <!--END SUP-->
> >           <!--SUB-->
> >        <xsl:attribute-set name="sub">
> >        <xsl:attribute name="font-size">smaller</xsl:attribute>
> >            <xsl:attribute name="baseline-shift">sub</xsl:attribute>
> >            <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
> >            <xsl:attribute name="keep-together">always</xsl:attribute>
> >        </xsl:attribute-set>
> >        <!--END SUP-->
> >
> >
> >
> > <xs:template match="text">
> >   <fo:block>
> >       <xsl:apply-templates/>
> >   </fo:block>
> > </xsl:template>
> >
> > <xsl:template match="sub">
> >    <fo:inline xsl:use-attribute-sets="sup">
> >    <xsl:apply-templates/>
> >    </fo:inline>
> >
> > </xsl:template>
> >
> > Thats all.
> >
> > On Fri, Dec 18, 2009 at 2:04 PM, Peter Hopfgartner 
> > <peter.hopfgartner@r3-gis.com <ma...@r3-gis.com>> 
> > wrote:
> >
> >     Nedim Buke wrote:
> >
> >         Hello,
> >
> >         You can use the following attributes to format as sup and sub
> >         respectively.
> >
> >           <!--SUP-->
> >            <xsl:attribute-set name="sup">
> >                <xsl:attribute name="font-size">smaller</xsl:attribute>
> >                <xsl:attribute name="baseline-shift">super</xsl:attribute>
> >                <xsl:attribute name="vertical-align">super</xsl:attribute>
> >                <xsl:attribute
> >         name="dominant-baseline">hanging</xsl:attribute>
> >                <xsl:attribute name="keep-together">always</xsl:attribute>
> >            </xsl:attribute-set>
> >            <!--END SUP-->
> >               <!--SUB-->
> >            <xsl:attribute-set name="sub">
> >            <xsl:attribute name="font-size">smaller</xsl:attribute>
> >                <xsl:attribute name="baseline-shift">sub</xsl:attribute>
> >                <xsl:attribute
> >         name="dominant-baseline">hanging</xsl:attribute>
> >                <xsl:attribute name="keep-together">always</xsl:attribute>
> >            </xsl:attribute-set>
> >            <!--END SUP-->
> >
> >
> >            <fo:inline xsl:use-attribute-sets="sup">
> >            <xsl:apply-templates/>
> >            </fo:inline>
> >
> >         Instead of attributes you can also use them direclty inside
> >         inline element.
> >
> >     Hello Nedim,
> >
> >     your way of formatting the sub/sup seems much more correct then
> >     mine was. Anyway, I'm not able to understand if this help me in my
> >     base problem.
> >
> >     Let's say, that I have e text element, which might contain
> >     formulas like
> >     <text>
> >     drinking H<sub>2</sub>O is healthly
> >     </text>
> >
> >     How should I write my XSL file, so that your sub/sup attributes
> >     are applied correctly?
> >
> >     Regards,
> >
> >     Peter
> >
> >         On Fri, Dec 18, 2009 at 1:11 PM, Peter Hopfgartner
> >         <peter.hopfgartner@r3-gis.com
> >         <ma...@r3-gis.com>
> >         <mailto:peter.hopfgartner@r3-gis.com
> >         <ma...@r3-gis.com>>> wrote:
> >
> >            Hello,
> >
> >            we would like to format chemical formulas with FOP. The
> >         formulas
> >            come from the XML file.
> >            We tried to include the FO instructions in the XML file,
> >         like in
> >            the following
> >
> >            H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O
> >
> >            Anyway, the formatting does not survive the XSL processing.
> >            Checking with -foout, the relevant fragment becomes "H2O".
> >
> >            Does anybody have any hint how to pass the formatting
> >         instructions
> >            to the final FO file?
> >
> >            Regards,
> >
> >            Peter
> >
> >            --
> >            Dott. Peter Hopfgartner
> >
> >            R3 GIS Srl - GmbH
> >            Via Johann Kravogl-Str. 2
> >            I-39012 Meran/Merano (BZ)
> >            Email: peter.hopfgartner@r3-gis.com
> >         <ma...@r3-gis.com>
> >            <mailto:peter.hopfgartner@r3-gis.com
> >         <ma...@r3-gis.com>>
> >
> >            Tel. : +39 0473 494949
> >            Fax  : +39 0473 069902
> >            www  : http://www.r3-gis.com
> >
> >
> >          
> >          ---------------------------------------------------------------------
> >            To unsubscribe, e-mail:
> >            fop-users-unsubscribe@xmlgraphics.apache.org
> >         <ma...@xmlgraphics.apache.org>
> >            <mailto:fop-users-unsubscribe@xmlgraphics.apache.org
> >         <ma...@xmlgraphics.apache.org>>
> >
> >            For additional commands, e-mail:
> >            fop-users-help@xmlgraphics.apache.org
> >         <ma...@xmlgraphics.apache.org>
> >            <mailto:fop-users-help@xmlgraphics.apache.org
> >         <ma...@xmlgraphics.apache.org>>
> >
> >
> >
> >
> >         -- 
> >         Nedim Buke
> >
> >
> >
> >     -- 
> >
> >     Dott. Peter Hopfgartner
> >
> >     R3 GIS Srl - GmbH
> >     Via Johann Kravogl-Str. 2
> >     I-39012 Meran/Merano (BZ)
> >     Email: peter.hopfgartner@r3-gis.com
> >     <ma...@r3-gis.com>
> >     Tel. : +39 0473 494949
> >     Fax  : +39 0473 069902
> >     www  : http://www.r3-gis.com
> >
> >
> >     ---------------------------------------------------------------------
> >     To unsubscribe, e-mail:
> >     fop-users-unsubscribe@xmlgraphics.apache.org
> >     <ma...@xmlgraphics.apache.org>
> >     For additional commands, e-mail:
> >     fop-users-help@xmlgraphics.apache.org
> >     <ma...@xmlgraphics.apache.org>
> >
> >
> >
> >
> > -- 
> > Nedim Buke
> 
> 



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


Re: Passing Formulas to FOP

Posted by Peter Hopfgartner <pe...@r3-gis.com>.
Works!

Probably I've outed myself as a complete XSL green horn.

Thank you,

Peter

Nedim Buke wrote:
> Hello Peter,
>
> As follows:
>
>   <!--SUP-->
>    <xsl:attribute-set name="sup">
>        <xsl:attribute name="font-size">smaller</xsl:
>
>     attribute>
>            <xsl:attribute name="baseline-shift">super</xsl:attribute>
>            <xsl:attribute name="vertical-align">super</xsl:attribute>
>            <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>            <xsl:attribute name="keep-together">always</xsl:attribute>
>        </xsl:attribute-set>
>        <!--END SUP-->
>           <!--SUB-->
>        <xsl:attribute-set name="sub">
>        <xsl:attribute name="font-size">smaller</xsl:attribute>
>            <xsl:attribute name="baseline-shift">sub</xsl:attribute>
>            <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>            <xsl:attribute name="keep-together">always</xsl:attribute>
>        </xsl:attribute-set>
>        <!--END SUP-->
>
>
>
> <xs:template match="text">
>   <fo:block>
>       <xsl:apply-templates/>
>   </fo:block>
> </xsl:template>
>
> <xsl:template match="sub">
>    <fo:inline xsl:use-attribute-sets="sup">
>    <xsl:apply-templates/>
>    </fo:inline>
>
> </xsl:template>
>
> Thats all.
>
> On Fri, Dec 18, 2009 at 2:04 PM, Peter Hopfgartner 
> <peter.hopfgartner@r3-gis.com <ma...@r3-gis.com>> 
> wrote:
>
>     Nedim Buke wrote:
>
>         Hello,
>
>         You can use the following attributes to format as sup and sub
>         respectively.
>
>           <!--SUP-->
>            <xsl:attribute-set name="sup">
>                <xsl:attribute name="font-size">smaller</xsl:attribute>
>                <xsl:attribute name="baseline-shift">super</xsl:attribute>
>                <xsl:attribute name="vertical-align">super</xsl:attribute>
>                <xsl:attribute
>         name="dominant-baseline">hanging</xsl:attribute>
>                <xsl:attribute name="keep-together">always</xsl:attribute>
>            </xsl:attribute-set>
>            <!--END SUP-->
>               <!--SUB-->
>            <xsl:attribute-set name="sub">
>            <xsl:attribute name="font-size">smaller</xsl:attribute>
>                <xsl:attribute name="baseline-shift">sub</xsl:attribute>
>                <xsl:attribute
>         name="dominant-baseline">hanging</xsl:attribute>
>                <xsl:attribute name="keep-together">always</xsl:attribute>
>            </xsl:attribute-set>
>            <!--END SUP-->
>
>
>            <fo:inline xsl:use-attribute-sets="sup">
>            <xsl:apply-templates/>
>            </fo:inline>
>
>         Instead of attributes you can also use them direclty inside
>         inline element.
>
>     Hello Nedim,
>
>     your way of formatting the sub/sup seems much more correct then
>     mine was. Anyway, I'm not able to understand if this help me in my
>     base problem.
>
>     Let's say, that I have e text element, which might contain
>     formulas like
>     <text>
>     drinking H<sub>2</sub>O is healthly
>     </text>
>
>     How should I write my XSL file, so that your sub/sup attributes
>     are applied correctly?
>
>     Regards,
>
>     Peter
>
>         On Fri, Dec 18, 2009 at 1:11 PM, Peter Hopfgartner
>         <peter.hopfgartner@r3-gis.com
>         <ma...@r3-gis.com>
>         <mailto:peter.hopfgartner@r3-gis.com
>         <ma...@r3-gis.com>>> wrote:
>
>            Hello,
>
>            we would like to format chemical formulas with FOP. The
>         formulas
>            come from the XML file.
>            We tried to include the FO instructions in the XML file,
>         like in
>            the following
>
>            H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O
>
>            Anyway, the formatting does not survive the XSL processing.
>            Checking with -foout, the relevant fragment becomes "H2O".
>
>            Does anybody have any hint how to pass the formatting
>         instructions
>            to the final FO file?
>
>            Regards,
>
>            Peter
>
>            --
>            Dott. Peter Hopfgartner
>
>            R3 GIS Srl - GmbH
>            Via Johann Kravogl-Str. 2
>            I-39012 Meran/Merano (BZ)
>            Email: peter.hopfgartner@r3-gis.com
>         <ma...@r3-gis.com>
>            <mailto:peter.hopfgartner@r3-gis.com
>         <ma...@r3-gis.com>>
>
>            Tel. : +39 0473 494949
>            Fax  : +39 0473 069902
>            www  : http://www.r3-gis.com
>
>
>          
>          ---------------------------------------------------------------------
>            To unsubscribe, e-mail:
>            fop-users-unsubscribe@xmlgraphics.apache.org
>         <ma...@xmlgraphics.apache.org>
>            <mailto:fop-users-unsubscribe@xmlgraphics.apache.org
>         <ma...@xmlgraphics.apache.org>>
>
>            For additional commands, e-mail:
>            fop-users-help@xmlgraphics.apache.org
>         <ma...@xmlgraphics.apache.org>
>            <mailto:fop-users-help@xmlgraphics.apache.org
>         <ma...@xmlgraphics.apache.org>>
>
>
>
>
>         -- 
>         Nedim Buke
>
>
>
>     -- 
>
>     Dott. Peter Hopfgartner
>
>     R3 GIS Srl - GmbH
>     Via Johann Kravogl-Str. 2
>     I-39012 Meran/Merano (BZ)
>     Email: peter.hopfgartner@r3-gis.com
>     <ma...@r3-gis.com>
>     Tel. : +39 0473 494949
>     Fax  : +39 0473 069902
>     www  : http://www.r3-gis.com
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail:
>     fop-users-unsubscribe@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>     For additional commands, e-mail:
>     fop-users-help@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>
>
>
>
> -- 
> Nedim Buke


-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgartner@r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com


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


Re: Passing Formulas to FOP

Posted by Nedim Buke <ne...@gmail.com>.
Hello Peter,

As follows:

  <!--SUP-->
   <xsl:attribute-set name="sup">
       <xsl:attribute name="font-size">smaller</xsl:
>
> attribute>
>        <xsl:attribute name="baseline-shift">super</xsl:attribute>
>        <xsl:attribute name="vertical-align">super</xsl:attribute>
>        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>        <xsl:attribute name="keep-together">always</xsl:attribute>
>    </xsl:attribute-set>
>    <!--END SUP-->
>       <!--SUB-->
>    <xsl:attribute-set name="sub">
>    <xsl:attribute name="font-size">smaller</xsl:attribute>
>        <xsl:attribute name="baseline-shift">sub</xsl:attribute>
>        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>        <xsl:attribute name="keep-together">always</xsl:attribute>
>    </xsl:attribute-set>
>    <!--END SUP-->
>


<xs:template match="text">
  <fo:block>
      <xsl:apply-templates/>
  </fo:block>
</xsl:template>

<xsl:template match="sub">
   <fo:inline xsl:use-attribute-sets="sup">
   <xsl:apply-templates/>
   </fo:inline>

</xsl:template>

Thats all.

On Fri, Dec 18, 2009 at 2:04 PM, Peter Hopfgartner <
peter.hopfgartner@r3-gis.com> wrote:

> Nedim Buke wrote:
>
>> Hello,
>>
>> You can use the following attributes to format as sup and sub
>> respectively.
>>
>>   <!--SUP-->
>>    <xsl:attribute-set name="sup">
>>        <xsl:attribute name="font-size">smaller</xsl:attribute>
>>        <xsl:attribute name="baseline-shift">super</xsl:attribute>
>>        <xsl:attribute name="vertical-align">super</xsl:attribute>
>>        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>>        <xsl:attribute name="keep-together">always</xsl:attribute>
>>    </xsl:attribute-set>
>>    <!--END SUP-->
>>       <!--SUB-->
>>    <xsl:attribute-set name="sub">
>>    <xsl:attribute name="font-size">smaller</xsl:attribute>
>>        <xsl:attribute name="baseline-shift">sub</xsl:attribute>
>>        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>>        <xsl:attribute name="keep-together">always</xsl:attribute>
>>    </xsl:attribute-set>
>>    <!--END SUP-->
>>
>>
>>    <fo:inline xsl:use-attribute-sets="sup">
>>    <xsl:apply-templates/>
>>    </fo:inline>
>>
>> Instead of attributes you can also use them direclty inside inline
>> element.
>>
>>  Hello Nedim,
>
> your way of formatting the sub/sup seems much more correct then mine was.
> Anyway, I'm not able to understand if this help me in my base problem.
>
> Let's say, that I have e text element, which might contain formulas like
> <text>
> drinking H<sub>2</sub>O is healthly
> </text>
>
> How should I write my XSL file, so that your sub/sup attributes are applied
> correctly?
>
> Regards,
>
> Peter
>
>> On Fri, Dec 18, 2009 at 1:11 PM, Peter Hopfgartner <
>> peter.hopfgartner@r3-gis.com <ma...@r3-gis.com>>
>> wrote:
>>
>>    Hello,
>>
>>    we would like to format chemical formulas with FOP. The formulas
>>    come from the XML file.
>>    We tried to include the FO instructions in the XML file, like in
>>    the following
>>
>>    H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O
>>
>>    Anyway, the formatting does not survive the XSL processing.
>>    Checking with -foout, the relevant fragment becomes "H2O".
>>
>>    Does anybody have any hint how to pass the formatting instructions
>>    to the final FO file?
>>
>>    Regards,
>>
>>    Peter
>>
>>    --
>>    Dott. Peter Hopfgartner
>>
>>    R3 GIS Srl - GmbH
>>    Via Johann Kravogl-Str. 2
>>    I-39012 Meran/Merano (BZ)
>>    Email: peter.hopfgartner@r3-gis.com
>>    <ma...@r3-gis.com>
>>
>>    Tel. : +39 0473 494949
>>    Fax  : +39 0473 069902
>>    www  : http://www.r3-gis.com
>>
>>
>>    ---------------------------------------------------------------------
>>    To unsubscribe, e-mail:
>>    fop-users-unsubscribe@xmlgraphics.apache.org
>>    <ma...@xmlgraphics.apache.org>
>>
>>    For additional commands, e-mail:
>>    fop-users-help@xmlgraphics.apache.org
>>    <ma...@xmlgraphics.apache.org>
>>
>>
>>
>>
>> --
>> Nedim Buke
>>
>
>
> --
>
> Dott. Peter Hopfgartner
>
> R3 GIS Srl - GmbH
> Via Johann Kravogl-Str. 2
> I-39012 Meran/Merano (BZ)
> Email: peter.hopfgartner@r3-gis.com
> Tel. : +39 0473 494949
> Fax  : +39 0473 069902
> www  : http://www.r3-gis.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


-- 
Nedim Buke

Re: Passing Formulas to FOP

Posted by Peter Hopfgartner <pe...@r3-gis.com>.
Nedim Buke wrote:
> Hello,
>
> You can use the following attributes to format as sup and sub 
> respectively.
>
>    <!--SUP-->
>     <xsl:attribute-set name="sup">
>         <xsl:attribute name="font-size">smaller</xsl:attribute>
>         <xsl:attribute name="baseline-shift">super</xsl:attribute>
>         <xsl:attribute name="vertical-align">super</xsl:attribute>
>         <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>         <xsl:attribute name="keep-together">always</xsl:attribute>
>     </xsl:attribute-set>
>     <!--END SUP-->
>    
>      <!--SUB-->
>     <xsl:attribute-set name="sub">
>     <xsl:attribute name="font-size">smaller</xsl:attribute>
>         <xsl:attribute name="baseline-shift">sub</xsl:attribute>
>         <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
>         <xsl:attribute name="keep-together">always</xsl:attribute>
>     </xsl:attribute-set>
>     <!--END SUP-->
>
>
>     <fo:inline xsl:use-attribute-sets="sup">
>     <xsl:apply-templates/>
>     </fo:inline>
>
> Instead of attributes you can also use them direclty inside inline 
> element.
>
Hello Nedim,

your way of formatting the sub/sup seems much more correct then mine 
was. Anyway, I'm not able to understand if this help me in my base problem.

Let's say, that I have e text element, which might contain formulas like
<text>
 drinking H<sub>2</sub>O is healthly
</text>

How should I write my XSL file, so that your sub/sup attributes are 
applied correctly?

Regards,

Peter
> On Fri, Dec 18, 2009 at 1:11 PM, Peter Hopfgartner 
> <peter.hopfgartner@r3-gis.com <ma...@r3-gis.com>> 
> wrote:
>
>     Hello,
>
>     we would like to format chemical formulas with FOP. The formulas
>     come from the XML file.
>     We tried to include the FO instructions in the XML file, like in
>     the following
>
>     H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O
>
>     Anyway, the formatting does not survive the XSL processing.
>     Checking with -foout, the relevant fragment becomes "H2O".
>
>     Does anybody have any hint how to pass the formatting instructions
>     to the final FO file?
>
>     Regards,
>
>     Peter
>
>     -- 
>
>     Dott. Peter Hopfgartner
>
>     R3 GIS Srl - GmbH
>     Via Johann Kravogl-Str. 2
>     I-39012 Meran/Merano (BZ)
>     Email: peter.hopfgartner@r3-gis.com
>     <ma...@r3-gis.com>
>     Tel. : +39 0473 494949
>     Fax  : +39 0473 069902
>     www  : http://www.r3-gis.com
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail:
>     fop-users-unsubscribe@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>     For additional commands, e-mail:
>     fop-users-help@xmlgraphics.apache.org
>     <ma...@xmlgraphics.apache.org>
>
>
>
>
> -- 
> Nedim Buke


-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgartner@r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com


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


Re: Passing Formulas to FOP

Posted by Nedim Buke <ne...@gmail.com>.
Hello,

You can use the following attributes to format as sup and sub respectively.

   <!--SUP-->
    <xsl:attribute-set name="sup">
        <xsl:attribute name="font-size">smaller</xsl:attribute>
        <xsl:attribute name="baseline-shift">super</xsl:attribute>
        <xsl:attribute name="vertical-align">super</xsl:attribute>
        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
        <xsl:attribute name="keep-together">always</xsl:attribute>
    </xsl:attribute-set>
    <!--END SUP-->

     <!--SUB-->
    <xsl:attribute-set name="sub">
    <xsl:attribute name="font-size">smaller</xsl:attribute>
        <xsl:attribute name="baseline-shift">sub</xsl:attribute>
        <xsl:attribute name="dominant-baseline">hanging</xsl:attribute>
        <xsl:attribute name="keep-together">always</xsl:attribute>
    </xsl:attribute-set>
    <!--END SUP-->


    <fo:inline xsl:use-attribute-sets="sup">
    <xsl:apply-templates/>
    </fo:inline>

Instead of attributes you can also use them direclty inside inline element.

On Fri, Dec 18, 2009 at 1:11 PM, Peter Hopfgartner <
peter.hopfgartner@r3-gis.com> wrote:

> Hello,
>
> we would like to format chemical formulas with FOP. The formulas come from
> the XML file.
> We tried to include the FO instructions in the XML file, like in the
> following
>
> H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O
>
> Anyway, the formatting does not survive the XSL processing. Checking with
> -foout, the relevant fragment becomes "H2O".
>
> Does anybody have any hint how to pass the formatting instructions to the
> final FO file?
>
> Regards,
>
> Peter
>
> --
>
> Dott. Peter Hopfgartner
>
> R3 GIS Srl - GmbH
> Via Johann Kravogl-Str. 2
> I-39012 Meran/Merano (BZ)
> Email: peter.hopfgartner@r3-gis.com
> Tel. : +39 0473 494949
> Fax  : +39 0473 069902
> www  : http://www.r3-gis.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


-- 
Nedim Buke

AW: Passing Formulas to FOP

Posted by Georg Datterl <ge...@geneon.de>.
Hi Peter, 

You write your stuff in your XML file and in does not survive the transformation. Maybe it already works if you add a default transformation which writes the tag unchanged into the fo file. Other solution: encode < with &lt; in your XML and let the transformation transform it back to <.

Regards,
 
Georg Datterl
 
------ Kontakt ------
 
Georg Datterl
 
Geneon media solutions gmbh
Gutenstetter Straße 8a
90449 Nürnberg
 
HRB Nürnberg: 17193
Geschäftsführer: Yong-Harry Steiert 

Tel.: 0911/36 78 88 - 26
Fax: 0911/36 78 88 - 20
 
www.geneon.de
 
Weitere Mitglieder der Willmy MediaGroup:
 
IRS Integrated Realization Services GmbH:    www.irs-nbg.de 
Willmy PrintMedia GmbH:                            www.willmy.de
Willmy Consult & Content GmbH:                 www.willmycc.de 
-----Ursprüngliche Nachricht-----
Von: Peter Hopfgartner [mailto:peter.hopfgartner@r3-gis.com] 
Gesendet: Freitag, 18. Dezember 2009 12:12
An: fop-users@xmlgraphics.apache.org
Betreff: Passing Formulas to FOP

Hello,

we would like to format chemical formulas with FOP. The formulas come from the XML file.
We tried to include the FO instructions in the XML file, like in the following

H<fo:inline vertical-align="sub" font-size="7pt">2</fo:inline>O

Anyway, the formatting does not survive the XSL processing. Checking with -foout, the relevant fragment becomes "H2O".

Does anybody have any hint how to pass the formatting instructions to the final FO file?

Regards,

Peter

-- 
 
Dott. Peter Hopfgartner
 
R3 GIS Srl - GmbH
Via Johann Kravogl-Str. 2
I-39012 Meran/Merano (BZ)
Email: peter.hopfgartner@r3-gis.com
Tel. : +39 0473 494949
Fax  : +39 0473 069902
www  : http://www.r3-gis.com


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


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