On 3/11/21 3:08 PM, Daniel Dekany wrote:
In 9.5.0 this CSS is not selected automatically anymore:

   <include location="xxe-config:docbook5/docbook5.xxe"/>

   <detect>
     <and>
       
<rootElementNamespace>http://docbook.org/ns/docbook</rootElementNamespace>
       <rootElementAttribute localName="conformance" value="docgen" />
     </and>
   </detect>

   <css name="DocBook for Docgen" location="docbook-for-docgen.css" />

If I go to the View menu, I can still select "DocBook for Docgen", but
the CSS is not selected automatically anymore.

Attached docbook-for-docgen.xxe and docbook-for-docgen.css work for me. ("Test.xml" is a sample "DocBook chapter for Docgen".)

Notice name="DocBook v5+ (docgen)", not
name="DocBook v5+". The following docbook-for-docgen.xxe creates a brand new configuration for XXE.

--------------------------------------------------------------
<configuration name="DocBook v5+ (docgen)"
  mimeType="application/x-docbook-5+xml"
  icon="xxe-config:common/mime_types/docbook.png"
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:db="http://docbook.org/ns/docbook";
  xmlns:svg="http://www.w3.org/2000/svg";
  xmlns:xi="http://www.w3.org/2001/XInclude";
  xmlns:xlink="http://www.w3.org/1999/xlink";
  xmlns:html="http://www.w3.org/1999/xhtml";>

  <include location="docbook5-config:docbook5.xxe"/>

  <detect>
   <and>

<rootElementNamespace>http://docbook.org/ns/docbook</rootElementNamespace>
     <rootElementAttribute localName="conformance" value="docgen" />
   </and>
  </detect>

  <css name="DocBook" />
  <css name="DocBook for Docgen" location="docbook-for-docgen.css" />

  <!-- OR SIMPLY
  <css name="A stylesheet for Docgen" location="docbook-for-docgen.css" />
  -->

</configuration>
--------------------------------------------------------------

The issue comes from the fact that both the stock "DocBook" CSS and your "DocBook for Docgen" CSS are alternate="false" stylesheets.

When several alternate="false" stylesheets are specified, the stylesheet having first name in alphabetical order wins.

Several ways to fix this. Two of these:

1) Comment out stock "DocBook" CSS, that is, add:
<css name="DocBook" />
before your:
<css name="DocBook for Docgen" location="docbook-for-docgen.css" />

OR, more simply:

2) Change the name of your custom CSS stylesheet. For example:
<css name="A stylesheet for Docgen" location="docbook-for-docgen.css" />
(name starts with an "A")




I guess that this regression is related to the view related
refactoring. Actually, I'm not sure how "detect" is supposed to work
together with things like "Help"/"Customize Configuration"/"Use
Current Views Settings as Default". Which is stronger when?

The settings made using the "View" menu THEN "Customize Configuration"/"Use Current Views Settings as Default" THEN the ".xxe" configuration file. That is, priority is given to what has been interactively specified by the user.




Also configuration/windowLayout is not supported anymore (which is
missing from the change log I believe). What's the idea there? The
plugin shouldn't add views, so that the user will have full control
over that aspect?

Configuration element <windowLayout> has been superseded by similar, but more powerful, <viewSettings> configuration element. See http://www.xmlmind.com/xmleditor/_distrib/doc/configure/viewSettings.html




In that case, it's not exactly easy to find the
above menu. Maybe it should be under View, new "Add View...". Also it
sounds as if it has too wide effect, because what the user wants (I
guess), is just add a ToC view or such, and not interfere with what
CSS is selected for the main view.


This can still be very easily done (and made automatically persistent, as of XXE v9.5) using "View|Add Views".
@import url(docbook5-config:css/docbook5.css);

title,
para {
    color: red;
}
<?xml version='1.0' encoding='UTF-8'?>
<configuration name="DocBook v5+ (docgen)"
  mimeType="application/x-docbook-5+xml"
  icon="xxe-config:common/mime_types/docbook.png"
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:db="http://docbook.org/ns/docbook";
  xmlns:svg="http://www.w3.org/2000/svg";
  xmlns:xi="http://www.w3.org/2001/XInclude";
  xmlns:xlink="http://www.w3.org/1999/xlink";
  xmlns:html="http://www.w3.org/1999/xhtml";>

  <include location="docbook5-config:docbook5.xxe"/>
  
  <detect>
   <and>
     <rootElementNamespace>http://docbook.org/ns/docbook</rootElementNamespace>
     <rootElementAttribute localName="conformance" value="docgen" />
   </and>
  </detect>

  <css name="DocBook" />
  <css name="DocBook for Docgen" location="docbook-for-docgen.css" />
  
  <!-- OR SIMPLY
  <css name="A stylesheet for Docgen" location="docbook-for-docgen.css" />
  -->
  
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<chapter conformance="docgen" version="5.0"
         xmlns="http://docbook.org/ns/docbook";
         xmlns:xlink="http://www.w3.org/1999/xlink";
         xmlns:xi="http://www.w3.org/2001/XInclude";
         xmlns:svg="http://www.w3.org/2000/svg";
         xmlns:m="http://www.w3.org/1998/Math/MathML";
         xmlns:html="http://www.w3.org/1999/xhtml";
         xmlns:db="http://docbook.org/ns/docbook";>
  <title>Test</title>

  <section>
    <title>Test</title>

    <para>Test</para>
  </section>
</chapter>
--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to