Page 1 of 1

Enable multiple selection of alternate CSSs from Framework Extension Script File

Posted: Thu Jun 30, 2022 6:12 pm
by Isabelle
Hello,
I am using Oxygen component 24.0.0.2 version.

I want to use alternate css.
In our frameworks we define them like this

Code: Select all

<author>
    <css>
      <addCss path="${frameworks}/descript.css" title="Default" alternate="false"/>
      <addCss path="${frameworks}/comment-hide.css" title="+ Hide comments" alternate="true"/>
      <addCss path="${frameworks}/comment-show.css" title="+ Show comments" alternate="true"/>
    </css>
</author>
the alternate css is like

Code: Select all

@namespace oxy url(http://www.oxygenxml.com/extensions/author);
oxy|comment {
  display: block !important;
}
But when we select one of the alternate css, it is treated like the main css.
I did not find where to enable multiple selection of alternate CSSs from a framework extension script file.

Can you explain me how to fix that.
Thank you
Regards,
Isabelle

Re: Enable multiple selection of alternate CSSs from Framework Extension Script File

Posted: Fri Jul 01, 2022 4:47 pm
by alex_jitianu
Hello,

Unfortunately, you can't set this option through the script. I've added an issue to make it available in the the next Oxygen release. Meanwhile, if you are compiling the script (you can compile the script to obtain the *.framework file by using the Compile Framework Extension script action from the editor contextual menu or by running the scripts/compileFrameworkScript.bat external tool from an all platform Oxygen distribution), you can apply a fix-up script afterwards. For example, you can apply an XSLT over the resulting *.framework file, maybe from an ANT script to automate it:

Code: Select all

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml"/>
   <xsl:template match="node() | @*">
       <xsl:copy>
           <xsl:apply-templates select="node() | @*"/>
       </xsl:copy>
   </xsl:template>
    
    <xsl:template match="authorExtension/field[@name='multipleAlternateSelectionEnabled']">
        <xsl:copy>
            <xsl:apply-templates select="@*"/>
            <Boolean>true</Boolean>
        </xsl:copy>
    </xsl:template>
    
</xsl:stylesheet>
Best regards,
Alex

Re: Enable multiple selection of alternate CSSs from Framework Extension Script File

Posted: Fri Jul 01, 2022 4:52 pm
by Isabelle
Hello Alex,

Thank you for your feedback.
We have found a workaround for now and we wait for your solution in the next version of Oxygen.

Regards,
Isabelle

Re: Enable multiple selection of alternate CSSs from Framework Extension Script File

Posted: Fri Oct 14, 2022 2:40 pm
by GabrielNedianu
Hello Isabelle,

We've just released Oxygen version 25 and now you can control CSS merging and selecting options in the framework script.
More information can be found at Oxygen XML Editor's documentation page: https://www.oxygenxml.com/doc/versions/ ... lr_c2c_45b

Regards,
Gabriel N.