Tekampe, Nils wrote:
I have a DocBook schema that has been extended by a few elements and that I 
would like to use with XMLMind. However, when I open an XML that is created 
after that schema, XMLMind does not recognize that this is a DocBook schema and 
does not enter the editor mode.

Is there any way to make XMLMind learn that this schema is also a DocBook 
schema?

I've written an add-on which allows to use XMLmind XML Editor to edit documents conforming to your DocBook 5 customization.

I'll send you privately a link allowing you to download the .zip file containing the add-on.

In order to install the add-on:

1) Download the .zip file and save it as is, zipped, somewhere. For example, let's say you saved it as "C:\temp\docbook_bsi.zip".

2) Start XXE.

3) Select Options|Preferences, "Install Add-ons" section.

4) Click "Search add-ons in this directory" and specify directory "C:\temp". (More info in http://www.xmlmind.com/xmleditor/_distrib/doc/help/installAddonsOptions.html)

5) Click OK to close the Preferences dialog box.

6) Select "Options|Install Add-ons".

7) Click the checkbox in front of "Configuration | DocBook 5, BSI customization". (More info in http://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.xmleditapp.app.part.InstallAddonsDialog.html)

8) Click OK to close the dialog box and restart XXE as instructed.

9) "File|New" should have now a "DocBook BSI|Book" entry and any DocBook 5 document having a root element with attribute version="5.0-variant bsi" will be recognized as being a "DocBook BSI" document.




--> About the docbook_bsi.zip add-on:

* The core of the add-on is configuration file docbookbsi.xxe

---
<configuration name="DocBook BSI" 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="version" namespace=""
                            value="5.0-variant bsi" />
    </and>
  </detect>

  <relaxng location="docbookbsi.rng" />

  <template name="Book" location="book.xml"/>
  <!-- Suppress these stock document templates -->
  <template name="Article" />
  <template name="Part" />
  <template name="Chapter" />
  <template name="Refentry" />
  <template name="Appendix" />
  <template name="Glossary" />
  <template name="Section" />

  <css name="DocBook" location="docbookbsi.css" />
  <!-- Suppress these stock stylesheets. -->
  <template name="Book" category="DocBook v5+/5.0" />
  <template name="Article" category="DocBook v5+/5.0" />
  <template name="Part" category="DocBook v5+/5.0" />
  <template name="Chapter" category="DocBook v5+/5.0" />
  <template name="Refentry" category="DocBook v5+/5.0" />
  <template name="Appendix" category="DocBook v5+/5.0" />
  <template name="Glossary" category="DocBook v5+/5.0" />
  <template name="Section" category="DocBook v5+/5.0" />

  <!-- docbookbsi.rng allows note to be completely empty. -->

  <elementTemplate name="withPara" selectable="override">
    <note xmlns="http://docbook.org/ns/docbook";><para></para></note>
  </elementTemplate>

</configuration>
---

* The docbook_bsi.css you sent me is unusable with XMLmind XML Editor (no offense intended). I have starting rewriting it as docbookbsi.css. For now, it's just:

---
@import url(docbook5-config:css/docbook5.css);

/*
 * Custom styles and style redefinitions here.
 */

note[type]:before {
    content: attr(type);
}
---

Even after you finish it, this CSS cannot be more than a few lines long given your customization of DocBook 5.

* Please do not forget to add xml:lang="de" to the root element of your documents, otherwise XMLmind XML Editor thinks that you are writing English documents.

* All what I've done can be done by any third-party XML guru having read:

XMLmind XML Editor - Configuration and Deployment
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/index.html






--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to