Error message when importing stylesheets

Questions about XML that are not covered by the other forums should go here.
MarkusHuneke
Posts: 5
Joined: Tue Oct 02, 2018 4:10 pm

Error message when importing stylesheets

Post 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?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error message when importing stylesheets

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MarkusHuneke
Posts: 5
Joined: Tue Oct 02, 2018 4:10 pm

Re: Error message when importing stylesheets

Post 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
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error message when importing stylesheets

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MarkusHuneke
Posts: 5
Joined: Tue Oct 02, 2018 4:10 pm

Re: Error message when importing stylesheets

Post 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.
Last edited by MarkusHuneke on Tue Jan 17, 2023 9:55 am, edited 1 time in total.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error message when importing stylesheets

Post 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
Screenshot 2023-01-17 at 07.47.45.png (154.91 KiB) Viewed 1098 times
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
MarkusHuneke
Posts: 5
Joined: Tue Oct 02, 2018 4:10 pm

Re: Error message when importing stylesheets

Post by MarkusHuneke »

Hi Radu, thats works! Ok, now I understand better, how the main file support works. Thanks for your help!
Kind regards,
Markus
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Error message when importing stylesheets

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply