Re: RFE: Improved whitespace treatment
"Leif Halvard Silli" <[email protected]>
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
Happy new year!
On 31 Dec 2020, at 10:25, Hussein Shafie wrote:
... snip ...
> In order to solve your issue, I would recommend using a customized
> HTML5 schema (a very simple *strict* subset) rather than our stock
> HTML5 schema.
OK. Here is my solution. I opened the xhtml5.xsd file and defined a new
complex element type called 'elementContentElement':
<xs:complexType mixed="false" name="elementContentElement">
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:group ref="flowContent"></xs:group>
</xs:sequence>
<xs:attributeGroup ref="globalAttributes"></xs:attributeGroup>
</xs:complexType>
(The 'elementConentType' is identical to the 'flowContentElement' except
for the @mixed attribute which is set to "false".)
Then I changed @base attribute of the xs:extension element inside the
setup for the body element (and on some other elements of similar XSD
construct - they are at least the <slot> and the <blockquote> element):
<xs:element name="body">
<xs:complexType>
<xs:complexContent>
<xs:extension base="elementContentElement">
<xs:attributeGroup
ref="bodyEventHandlerAttributes"></xs:attributeGroup>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
Finally I changed the sectioning content elements to the new (but
traditional ...) element type:
<xs:element name="article" type="elementContentElement"/>
<xs:element name="section" type="elementContentElement"/>
<xs:element name="nav" type="elementContentElement"/>
<xs:element name="aside" type="elementContentElement"/>
Of course, I could have limited myself to changing <body> and the
sectioning contents elements. However, I made the above changes to
<blockquote>, <main>, <form>, <header>, <footer>, <dd>, <li>, <main>,
<map>, <dialog>, <slot> and <canvas>. But for now, I did not change the
elements <li>, <dd> and <div>.
Finally I have 2 questions:
1) How could I make the changes into a customization, rather than
alterning the original XSD?
2) How can I program XXE to defualt to include a <p> child when I add a
new <li> and <dd> elements?
Leif Halvard Silli
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support