Edits to xsdDocHtml.xsl Don't Have Any Effect

This should cover W3C XML Schema, Relax NG and DTD related problems.
Posts: 37
Joined: Wed Jun 19, 2013 1:49 am

Edits to xsdDocHtml.xsl Don't Have Any Effect

Post by cjboorman » Tue Dec 22, 2015 12:24 am

I'm trying to customize the schema documentation XSLT transformation (C:\Program Files\Oxygen XML Editor 17\frameworks\schema_documentation\xsl\xsdDocHtml.xsl) and have found that my change doesn't have any effect (I gave myself read/write permission to this file).

I want to add a link to my own cascading stylesheet to the resulting HTML file. I.e., add the line:

Code: Select all

<link rel="stylesheet" href="../mystyles.css" type="text/css" />
I found three lines in the XSL file that link to your style sheet:

Code: Select all

<link rel="stylesheet" href="docHtml.css" type="text/css" />
So I figured all I had to do was add my extra line to your XSL file three times – one time after each of your three lines.
But my addition doesn't show up in the resulting HTML file. It's as if I'm editing the wrong file! What is going on?

Posts: 793
Joined: Wed Nov 16, 2005 11:11 am

Re: Edits to xsdDocHtml.xsl Don't Have Any Effect

Post by alex_jitianu » Tue Dec 22, 2015 10:35 am


You mentioned you have customized {oxygenInstallDir}\frameworks\schema_documentation\xsl\xsdDocHtml.xsl. This means that the CSS file copied and applied is: {oxygenInstallDir}\frameworks\schema_documentation\xsl\docHtml.xsl. You could just add your CSS rules inside this file and you wont have to do anything else.

If you don't want the previous approach then please tell me if after you've done your changes, when you look inside the generated HTML, is the "link" to your CSS present there? I expect there is. What I suspect missing is the fact that the CSS file also has to be copied next to the HTML output in order for the link to actually work. There are at least two ways to do that:
- inside xsdDocHtml.xsl there is a template that copies the default CSS file:

Code: Select all

<xsl:template name="copyCSSFile">
<xsl:result-document href="{$cssCopyLocation}" method="text">
<xsl:value-of disable-output-escaping="yes" select="unparsed-text($cssRelativeLocationToXSL,'UTF-8')"/>
You could append inside this template another xsl:result-document that copies the additional CSS. You can put your CSS next to the XSL like we are doing and compose absolute paths based on that assumption.

Best regards,

Post Reply