xsl-list
[Top] [All Lists]

Re: FO cross references

2005-03-11 10:12:14
Hi Markus,

thank you for your instructions.
The fofile.xml seems to be correct as I get:

<fo:block language="it" margin-left="3pt" font-size="10pt" space-after="4pt" space-before="4pt" id="N4008BE" hyphenate="true">Per i componeneti cfr. la sezione img

(p.  <fo:page-number-citation ref-id="img"/>).

</fo:block>

and

<fo:block id="img" font-style="italic" font-size="14pt" space-before="20pt" space-after="12pt"/>
<fo:table>
....
</fo:table>

But when I try the second step I get:
E The process ended with code : 2 The error was : [ERROR] file:/C:/documenti/MAG/mag_2_0/Documentazione/Reference2.xml_xslt:10428:50 page-number-citation must contain "ref-id"

I'm using FOP inside oXygen 5.1. The version of Xalan is 2.5.1, no idea of the FOP version (I've looked everywhere...)

I'm quite desperate...



Markus Abt wrote:

Hi Elena,

I guess you are using Fop to convert your XML and XSL to PDF this way:
fop -xml file.xml -xsl file.xsl -pdf outfile.pdf

Internally, this happens in two steps:
1. Transforming the XML to FO using the XSL stylesheet.
2. Rendering the intermediate FO to PDF.

Fop uses Xalan for the first step. You can find Xalan in the lib/ subdirectory
of your Fop installation. You can do the two steps separately:

step 1 (in one line):
java -cp %FOP_HOME%\lib\xalan-2.4.1.jar org.apache.xalan.xslt.Process
                 -in file.xml -xsl file.xsl -out fofile.xml

step 2:
fop -fo fofile.xml -pdf outfile.pdf

This way, maybe you get better error messages.
Even better, you can examine the resulting FO to find logical errors.

If you can't solve the problem, please also post the version numbers
of Fop and Xalan you are using.

Markus

__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de




----------
Von:    Elena Pierazzo
Gesendet:       Freitag, 11. März 2005 11:28
An:     xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff:        Re: [xsl] FO cross references

Hi Markus,

The problem is that I don't have any output, just the error messages. The ID of table is unique (the file is valid) and when I generate an HTML from an XSL the cross reference is perfectly working.

Elena

Markus Abt wrote:

Hi Elena,

options 1 and 2 should work and generate the same result.
Maybe your IDs ("img" in your example) are not unique in
the result document, or are not valid as IDs?

Please take a look at / or post the corresponding parts of
your result (FO) document _after_ transformation.

Markus
__________________________
Markus Abt
Comet Computer GmbH
http://www.comet.de


----------
Von:    Elena Pierazzo
Gesendet:       Donnerstag, 10. März 2005 16:59
An:     xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff:        [xsl] FO cross references

Hi all,
I need to produce cross references with an XSL:FO style sheet from a TEI file.
My text is encoded as follow:

<TEI.2>
...
for such aspect see <ref target="img">the img table</ref>
..

<table id="img>
..
</table>

</TEI.2>

I've tried the following options:

1. <xsl:template match="ref">
<xsl:apply-templates/>
(p. <xsl:text> </xsl:text>
      <fo:page-number-citation ref-id="{(_at_)target}"/>)
</xsl:template>

2. <xsl:template match="ref">
<xsl:apply-templates/>
(p. <xsl:text> </xsl:text>
      <fo:page-number-citation>
          <xsl:attribute name="ref-id">
              <xsl:value-of select="@target"/>
          </xsl:attribute>
          </fo:page-number-citation>)
</xsl:template>

3. <xsl:template match="ref"> <!-- taken from the TEI style sheets -->
<xsl:apply-templates/>
(p. <xsl:text> </xsl:text>
      <fo:basic-link>
              <xsl:attribute name="internal-destination">
              <xsl:value-of select="translate(@target,'_','-')"/>
          </xsl:attribute>)
</xsl:template>


and
<xsl:template match="table">
<fo:block space-after="12pt" space-before="20pt" font-size="14pt" font-style="italic" id="{generate-id()}"> <!-- this is needed for TOC -->
          <fo:inline id="{(_at_)id}"/>
..
</xsl:table>


None is working.
The option 1 is apparently working but no page number is putted in output

Option 2 my FOP says:
SystemID: null
DEscription: E The process ended with code : 2 The error was : [ERROR] file://Reference2.xml_xslt:9629:757 ref-id must be specified in page-number-citation

Option 3 my FOP says:
SystemID: null
Description: E The process ended with code : 2 The error was : [ERROR] file://Reference2.xml_xslt:9629:757 internal-destination or external-destination must be specified in basic-link

Thank you
Elena





--
Elena Pierazzo
Dipartimento Studi Italianistici
Via del Collegio Ricci 10
56126 Pisa
tel. +39 0502215056


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>