VERY, VERY FRUSTRATING...

Here should go questions about transforming XML with XSLT and FOP.
twrichter
Posts: 13
Joined: Sun Jul 19, 2009 8:13 pm

VERY, VERY FRUSTRATING...

Post by twrichter »

Hi,

I admit I am a complete dummy concerning docbook.

BUT: we doesn't this work???:

- Making a docbook file - complete template (docbook 5 , file new)
- associating XSLT/CSS stylesheet: docbook_custom.xsl (complete template!)

ALL COMPLETEY TEMPLATES - nothing else done.

And then, when transforming to PDF:

SystemID: /opt/oxygen/frameworks/docbook/xsl/fo/docbook_custom.xsl
Programmname: Saxon6.5.5
Feherlevel: error
Beschreibung: Failed to compile stylesheet. 2 errors detected.


and:

SystemID: /opt/oxygen/frameworks/docbook/xsl/highlighting/common.xsl
Programmname: Saxon6.5.5
Feherlevel: warning
Beschreibung: Failed to load net.sf.xslthl.ConnectorSaxon6 - net.sf.xslthl.ConnectorSaxon6
Anfang: 33:0


I wanted to buy Oxygen (having tried the test version). But: when even the templates don't work?????

Regards
Thomas :| :|
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: VERY, VERY FRUSTRATING...

Post by sorin_ristache »

Hello,
twrichter wrote:we doesn't this work???:

- Making a docbook file - complete template (docbook 5 , file new)
- associating XSLT/CSS stylesheet: docbook_custom.xsl (complete template!)
If you transform a valid DocBook document with a DocBook stylesheet, for example ${frameworks}/docbook/xsl/fo/docbook.xsl or ${frameworks}/docbook/xsl/html/docbook.xsl the output is generated without errors without setting any parameters specific for DocBook transformations. Just go to File -> New, select one of the DocBook templates and set a DocBook stylesheet as the XSL URL in the scenario.

If you want to use docbook_custom.xsl you have to add the XSLTHL library as scenario extension. As you can see docbook_custom.xsl imports highlight.xsl which needs the XSLTHL extension library. The predefined DocBook scenarios called DocBook PDF, DocBook HTML and DocBook HTML - Chunk have this library already set so you can use one of these scenarios.


Regards,
Sorin
twrichter
Posts: 13
Joined: Sun Jul 19, 2009 8:13 pm

??????

Post by twrichter »

Hello Sorin,

thanks for answering. I have done as you posted. But still...

So I have mad a VERY simple example:
File test1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5 ... ocbook.rng" type="xml"?>
<?xml-stylesheet type="text/xsl" href="../../../opt/oxygen/frameworks/docbook/xsl/fo/GO.xsl"?>

Code: Select all

<article xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">

<info>
<title>Article Template Title</title>
<?hard-pagebreak?>
<author>
<orgname>Organization Name</orgname>
<address>
<city>City</city>
<street>Street</street>
<postcode>000000</postcode>
<country>Country</country>
</address>
<email>user@example.com</email>
</author>
</info>
<sect1>
<title>Section1 Title</title>
<subtitle>Section1 Subtitle</subtitle>
<?hard-pagebreak?>
<para>Text</para>
</sect1>
</article>
GO:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xml:lang="de"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:d = "http://docbook.org/ns/docbook"
exclude-result-prefixes="d"
version="1.0">
<xsl:import href="docbook.xsl"/>
<!-- Apply XHLTHL extension. -->
<xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-after='page'/>
</xsl:template>
</xsl:stylesheet>
Both seem to be valid (no error message). But no hard page-break took place. I have tried all I could think of (d: instead of fo;, d:match instead of match). But no way.

By the way: the above example still doesn't word although I used the DocBook PDF scenaring.

It's very frustrating...

Regards
Thomas
twrichter
Posts: 13
Joined: Sun Jul 19, 2009 8:13 pm

Re: Halleluja found it

Post by twrichter »

There is a not easy to find checkbox in the dialog. Check it when applying your own code.
It works! Sometimes it is easier to work with text based tools ..
But now I can buy with a good feeling!
Regards
Thomas
Post Reply