Edits to xsdDocHtml.xsl Don't Have Any Effect

This should cover W3C XML Schema, Relax NG and DTD related problems.
cjboorman
Posts: 37

Edits to xsdDocHtml.xsl Don't Have Any Effect

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?
alex_jitianu
Posts: 632

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

Tue Dec 22, 2015 10:35 am

Hello,

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')"/>
  </xsl:result-document>
</xsl:template>

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,
Alex

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest