All this is documented here: "XMLmind XML Editor - Configuration and Deployment", http://www.xmlmind.com/xmleditor/_distrib/doc/configure/index.html

On 1/1/21 5:59 PM, Leif Halvard Silli wrote:

Finally I have 2 questions:

1) How could I make the changes into a customization, rather than alterning the original XSD?


"Chapter 5. Customizing an existing configuration", http://www.xmlmind.com/xmleditor/_distrib/doc/configure/customizing.html



2) How can I program XXE to defualt to include a <p> child when I add a new <li> and <dd> elements?

"Chapter 6. Configuration elements", "11. elementTemplate", http://www.xmlmind.com/xmleditor/_distrib/doc/configure/elementTemplate.html



In order to thank you for your contributions, I did that for you.

File custom_xhtml_config/0xhtml5.xxe:
---
<configuration name="XHTML 5" mimeType="application/xhtml+xml"
icon="xxe-config:common/mime_types/xhtml.png" extensions="xhtml xht html htm"
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration";
  xmlns:html="http://www.w3.org/1999/xhtml";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>

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

  <schema>
    <location>http://www.w3.org/1999/xhtml xhtml5_subset.xsd</location>
  </schema>

  <elementTemplate name="withP" selectable="override">
    <li xmlns="http://www.w3.org/1999/xhtml";><p></p></li>
  </elementTemplate>

  <elementTemplate name="withP" selectable="override">
    <dd xmlns="http://www.w3.org/1999/xhtml";><p></p></dd>
  </elementTemplate>

  <!-- Stock elementTemplates use "plain" li, dd.
       Therefore also redefine these stock elementTemplates here. -->

  <elementTemplate name="li" selectable="override">
<ul xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ul>
  </elementTemplate>

  <elementTemplate name="li" selectable="override">
<ol xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ol>
  </elementTemplate>

  <elementTemplate name="a">
<ol type="a" xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ol>
  </elementTemplate>

  <elementTemplate name="A">
<ol type="A" xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ol>
  </elementTemplate>

  <elementTemplate name="i">
<ol type="i" xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ol>
  </elementTemplate>

  <elementTemplate name="I">
<ol type="I" xmlns="http://www.w3.org/1999/xhtml";><li cfg:template="withP" /><li cfg:template="withP" /></ol>
  </elementTemplate>

  <elementTemplate name="dt_dd" selectable="override">
    <dl xmlns="http://www.w3.org/1999/xhtml";>
      <dt></dt><dd cfg:template="withP" />
      <dt></dt><dd cfg:template="withP" />
    </dl>
  </elementTemplate>
</configuration>
---

Ready to use customization (custom_xhtml_config.tar.gz) attached to this email. Unpack it in your $HOME/Library/Application Support/XMLmind/XMLEditor9/addon/, clear all caches (e.g. rm -r $HOME/Library/Application Support/XMLmind/XMLEditor9/cache) and then restart XXE.

Note that xhtml5_subset.xsd is merely a modified copy of xhtml5.xsd. Not elegant. In order to use W3C XML Schema redefine ("4.2.2 Including modified component definitions", https://www.w3.org/TR/xmlschema-1/#composition), we would need to make xhtml5.xsd more customizable first.

Attachment: custom_xhtml_config.tar.gz
Description: application/gzip

--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to