Chunking HTML output (and XHTML) with Oxygen 3.1

Having trouble installing Oxygen? Got a bug to report? Post it all here.
catterall
Posts: 63
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Chunking HTML output (and XHTML) with Oxygen 3.1

Post by catterall »

The following was done on an XML file that transforms correctly as a single chunk using .../docbook/(x)html/docbook.xsl

(x) indicates done both with and without the 'x'

In the transformation scenario I have:
under XSLT: XSL URL: .../docbook/xsl/(x)html/chunk.xsl
transformer: Saxon
under FO Processor: off (nothing checked)
under Output: a file name .../try.html
(I presume this would define the filename for the root chunk)
open in browser
all Show As options are off

When I try to transform I get 2 errors:

E Failed to compile stylesheet. 1 error detected.
E Failure reading file .../(x)html/docbook.xsl in chunk.xsl at line 6
(docbook.xsl IS present in the same directory as chunk.xsl)

If I load .../3.1/oxygen/docbook/xsl/(x)html/chunk.xsl into the Oxygen editor, I get
well-formed
validate fails: 2 errors
E had IO exception with stylesheet file docbook.xsl at chunk.xsl, line 18
F org.apache.xml.utils.WrappedRuntimeException: could not find variable with the name of chunker.output.encoding at chunk.xsl line 1

Can anyone advise me how to chunk (x)html output

Ron
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Ron,

We will test this tomorrow. Recently (one or two weeks ago) we tested the chunks with oXygen 3.0 and everything worked fine. However the DocBook stylesheets were updates in 3.1 so it is possible to get different results.

Best Regards,
George
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The stylesheet chunk.xsl writes the root chunk in a file "index.html" which will contain links to other chunks. So you can leave the "Save As" field empty. For example chunk.xsl transforms the Docbook sample included in <oXygen/> called sample.xml to the files index.html and ar01.html.

Best regards,
Sorin
catterall
Posts: 63
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Post by catterall »

Sorin

Tried as you say - 'Save as' left blank and tried to transform the docbook sample.xml with chunk.xsl.

I got the same two errors as before

I'm running Oxygen 3.1 on a G4 desktop Mac with OS 10.2.8

Maybe as George says its a problem with the update of the DocBook files which accompanied the Oxygen 3.1 release.

Did you test on 3.0 by any chance?

Many thanks for the reply

Regards

Ron
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Ron,

Do you have some catalogs set up ? If yes what catalogs do you have ?
Eventually you can try renaming the com.oxygenxml directory from your user home (or from user.home/Library/Preferences on Mac) and give it a try.

Best Regards,
George
catterall
Posts: 63
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Post by catterall »

George

Thanks for pointing me to the catalog - that looks like where the problem might be. I did correct a 3.0 to 3.1 error in the catalog, but all that did was change the line in chunk.xsl that gave the error

E Failed to compile stylesheet. 1 error detected.
E failure reading file:/html/docbook.xsl file:Applications/Utilities/oxygen/3.1/oxygen/docbook/xsl/xhtml/chunk.xsl 18:1

line 18 of chunk.xsl is - <xsl:import href="docbook.xsl"/>
the error mssage is - E Failure reading file:/html/docbook.xsl

I can't see why it's looking for /html/docbook.xsl, but it does look like a catalog problem.

My catalog file is (problem must be in the first group):

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE catalog
PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog Vl.O//EN"
"http://www.oasis-open.org/committees/en ... atalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

<!-- locate the docbook.xsl and chunk.xsl files - for html, xhtml or fo -->
<group prefer="public" xml:base="file:///Applications/Utilities/oxygen/3.1/oxygen/docbook/xsl/" >
<uri
name="docbook.xsl"
uri="xhtml/docbook.xsl"
/>
<uri
name="chunk.xsl"
uri="xhtml/chunk.xsl"
/>
</group>

<!-- XML Catalog data for DocBook XML V4.2 -->
<!-- DocBook modules -->
<group prefer="public" xml:base="file:///Applications/Utilities/oxygen/3.1/oxygen/docbook/dtd/" >
<public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
uri="docbookx.dtd"/>
<public publicId="-//OASIS//DTD DocBook CALS Table Model V4.2//EN"
uri="calstblx.dtd"/>
<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
uri="soextblx.dtd"/>
<public publicId="-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN"
uri="dbpoolx.mod"/>
<public publicId="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN"
uri="dbhierx.mod"/>
<public publicId="-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN"
uri="dbgenent.mod"/>
<public publicId="-//OASIS//ENTITIES DocBook Notations V4.2//EN"
uri="dbnotnx.mod"/>
<public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
uri="dbcentx.mod"/>
</group>
<!-- end of DocBook modules -->

<!-- ISO entity sets -->
<group prefer="public" xml:base="file:///Applications/Utilities/oxygen/3.1/oxygen/docbook/dtd/ent/" >
<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
uri="ent/iso-num.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
uri="ent/iso-pub.ent"/>
<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
uri="ent/iso-tech.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
uri="ent/iso-lat1.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
uri="ent/iso-lat2.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
uri="ent/iso-grk1.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
uri="ent/iso-grk2.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
uri="ent/iso-grk3.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
uri="ent/iso-grk4.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
uri="ent/iso-amsa.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
uri="ent/iso-amsb.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
uri="ent/iso-amsc.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
uri="ent/iso-amsn.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
uri="ent/iso-amso.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
uri="ent/iso-amsr.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
uri="ent/iso-box.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
uri="ent/iso-cyr1.ent"/>
<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
uri="ent/iso-cyr2.ent"/>
</group>
<!-- end of ISO entity sets -->
<!-- End of catalog data for DocBook XML V4.2 -->
</catalog>

Ron
catterall
Posts: 63
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Post by catterall »

George

OK, I finally beat this one. It wasn't a catalog problem at all. Perhaps the answer might be of interest to others.

When I tried to chunk XHTML output - any of following ways:

1. No XSL customization, no catalog (other than the default ones that Oxygen throws in). XSLT by chunk.xsl Save As set to some pathname/filename.html

2. No XSL customization, no catalog (not even the default ones that Oxygen throws in) - slow of course but worth a try. XSLT by chunk.xsl Save As set to some pathname/filename.html

3. Repeat 1. with XSL customization with:
<!-- now set the changes to the standard XSL stylesheet -->
<!-- set the output filename for the root file -->
<xsl:param name="root.filename" select="'index.html'" />
<!-- use id values for filenames below the root file -->
<xsl:param name="use.id.as.filename" select="1" />
<!-- set the output directory for the HTML files this needs to be created in advance <xsl:param name="base.dir" select="'/Libary/WebServer/Documents/catterall/_SGGK/_XML/_HTMLout/'" />
<!-- select fast chunking mode OFF for safety-->
<xsl:param name="chunk.fast" select="0" />
<!-- put chapter sections in separate files -->
<xsl:param name="chunk.section.depth" select="2" />
<!-- put the preliminary text in a chapter (i.e. that before the first section) into a separate file -->
<xsl:param name="chunk.first.sections" select="1" />
<!-- set the output character set -->
<xsl:param name="chunker.output.encoding" select="'ISO-8859-1'" />

XSLT by chunk.xsl

4. repeat 2. with same customization

In all cases what happens is pathname/filename.html is created, and the browser opens it displaying a blank (empty) page and the message 'transformation successful'. This new file is actually left completely empty, and the output (all the chunked files) is directed to new files created in my .../oxygen/ directory (where the application is.)

So Oxygen appears to be ignoring the Save As filename, ignoring the XSL customization relevant to output (it does do all the other things I have in the XSl customization layer, so it is reading the file) and reverting to some system default for chunked output.

Comments/experience anyone?

Ron
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

chunk.xsl does not look at the output file parameter and writes the output to index.html. That's how Norman Walsh created this stylesheet and that's why you can leave the "Save As" field empty (the file listed in this field, which normally contains the stylesheet output, will be empty at the end of this particular transformation). <oXygen/> will open that file in a browser because you checked the "Open in browser" checkbox and <oXygen/> cannot know that the stylesheet will place its output in other file without analyzing the stylesheet before the transformation.

The chunked output (the html or xhtml stylesheet) will be placed in the directory specified by the base.dir parameter. The files in your ../oxygen/ directory were created by other transformation or other application. If you delete them, set the base.dir parameter to other directory and run the transformation again they will not be created. I checked that more than once.

Regards,
Sorin
catterall
Posts: 63
Joined: Sat Jan 24, 2004 12:10 am
Location: Oaxaca, Mexico
Contact:

Post by catterall »

Many thanks Sorin, that sorts a lot out for me.
Ron
Post Reply