Page 1 of 1

Error message when importing stylesheets

Posted: Mon Jan 16, 2023 1:34 pm
by MarkusHuneke
Hi,
I am writing a customisation stylesheet for a Docbook to PDF transformation. When I try to import stylesheets via the main file (to get a better overview of all the customisations), I get a series of warnings that various files are imported more than once, e.g.
"frameworks/docbook/xsl/common/utility.xsl is included or imported more than once."
This is because in each imported xsl file the docbook.xsl is imported:

Code: Select all

<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl"/>
However, if I omit the import, I get error messages that some framework templates and variables called in the stylesheet do not exist and the transformation scenario cannot be called.

Apparently it is not enough to import the framework in the main file.

How can I get around this behaviour?

Re: Error message when importing stylesheets

Posted: Mon Jan 16, 2023 1:51 pm
by Radu
HI Markus,

So you are editing a small XSLT module which is imported/included directly or indirectly in the main DocBook XSLT stylesheet, right?
Maybe our "Main Files" support might help: https://www.oxygenxml.com/doc/versions/ ... iting.html
Basically when editing the XSLT module Oxygen needs to know which XSLT stylesheet is the main file which should be validated instead of it.

Regards,
Radu

Re: Error message when importing stylesheets

Posted: Mon Jan 16, 2023 1:57 pm
by MarkusHuneke
Hi Radu,
I have already switched on the main file support, but I still get the error message. I am at a loss as to where to look for a solution.
Markus

Re: Error message when importing stylesheets

Posted: Mon Jan 16, 2023 2:11 pm
by Radu
Hi,

It's hard to give advice as I do not have the entire setup on my side to experiment with.
If you give me a small sequence of steps about what to do on my side to have a similar setup I could try to see if I can reproduce the problem and look into it.

Regards,
Radu

Re: Error message when importing stylesheets

Posted: Mon Jan 16, 2023 2:19 pm
by MarkusHuneke
Hi Radu,
ok, I´ll send you here part of my configuration. In the main file you find on top the imported xslt-files. I'm sure I'm doing something obviously wrong.

Re: Error message when importing stylesheets

Posted: Tue Jan 17, 2023 8:49 am
by Radu
Hi Markus,

Thanks for the samples.
So you have the main "db5_customize_main_v1.xsl" which imports the docbook.xsl

Code: Select all

<xsl:import href="http://docbook.sourceforge.net/release/xsl-ns/current/fo/docbook.xsl"/>
Oxygen resolves your reference via the XML catalogs to this location:

Code: Select all

OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/fo/docbook.xsl
And then the stylesheet "myqandas.xsl" has another reference to the "docbook.xsl".
Let's say I remove from "myqandas.xsl" the include to "docbook.xsl", and I get validation errors.
Then I enable the "Main Files" support in the Oxygen Project and add there a reference to "db5_customize_main_v1.xsl". After this the "myqandas.xsl" should be reported as valid.
Screenshot 2023-01-17 at 07.47.45.png

Re: Error message when importing stylesheets

Posted: Tue Jan 17, 2023 9:54 am
by MarkusHuneke
Hi Radu, thats works! Ok, now I understand better, how the main file support works. Thanks for your help!
Kind regards,
Markus

Re: Error message when importing stylesheets

Posted: Tue Jan 17, 2023 10:12 am
by Radu
Hi Markus,

I'm glad this works for you.
Whenever you refer to a main XSLT file in the Oxygen "Main Files" folder, Oxygen goes recursively through the main XSLT and finds all modules and submodules.
Then when such a module XSLT document is opened and edited, Oxygen actually validated the main XSLT instead of validating the module which may be valid by itself.
The Outline view will present for the current edited XSLT module also components which were gathered from all other modules as well.
Also when using content completion in call templates for example "<xsl:call-template name=""/>" Oxygen should show you all named templates gathered from the entire set of XSLT modules referenced in the main XSLT.

Regards,
Radu