On 11.07.2025 17:49 by Hussein Shafie:
On Fri, Jul 11, 2025 at 4:30 PM Leif wrote:
It would make XXE users stop cursing the Universe (or XXE or
XhtML rendering rules) for those empty lines that pops up.
This never happens to me as an XXE user (who exclusively uses XXE to
create and modify my XML documents and HTML pages). However I feel
sorry when I look at the HTML source of documents saved by XXE because
they are indeed poorly indented. Fortunately for me, I very rarely do
this.
So perhaps the keyword in your statement is «exclusively».
(And in that regard, I do – once again – not complain about the poor
indentation, but about the empty lines in the WYSIWYG editor. The poor
indentation is great for the getting the best WYSIWYG displayh in XXE ...)
That said, the poor indentation is part of the problem when it comes to
«exclusively». I really cannot explain the steps that has lead to those
empty lines time and again. But it is probably related to the fact that
we were two persons (until my wife passed away earlier this year) and
also, and probably more importantly, that I do edit the source code from
time to time, with another editor.
We also use XInclude a lot. Could it, somehow, be related to that? I
just ask + identify how our editing perhaps has been different from
yours ... Also, sometimes, I am almost certain that it is not editing
with an external editor that is the problem ...
XXE’s current behavior has several times caused us to type text
(and not just space characters) as direct children of the <body>
elements (and other elements where such direct text nodes are
illogical). Why? Because it is difficult to spot that you are
actually typing a direct child text node, instead of typing inside a
<p> element.
This never happens to me as an XXE user.
Could it be because you are an expert user? It has happened, I would not
say a lot, but it is has not been unfrequent.
An XHTML5 <body> found in XXE XHTML5 templates looks like this (hence
no text placeholders in <body> where you could type something):
---
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8"/>
<title></title>
</head>
<body><p></p></body>
</html>
---
and if you use Edit|Replace to replace an XHTML5 <body> by another
<body>, you get this (hence no text placeholders in <body> where you
could type something):
---
<body></body>
---
Again, you are living in a world where the user(s) *exclusively* use(s)
XXE’s semantic WYSIWYG interface to edit the document.
It only requires a **single** space character to occur before or after a
block element that is the child of a «complex» parent element, and –
voila – it will look, in XXE’s sematnic HTML WYSIWYG interace, as if
there is an empty paragraph in the document!
And if there is an empty paragraph, what do you do? The temptation will
be great to either delete it or to fill it with content.
In my opinion, this is a brittle construct.
Fortunately, now I have a tool that minifies XML code for me, so I can
paste code into XXE’s source code editor or use it to fix code that XXE
reacts allergically to ...
I would make the above XSD variant (with support for <section>,
<article> etc) the default, and offer users to permit text nodes as
direct children, if they explitly ask for it.
I'm sorry but we prefer to stick to the WHATWG spec as closely as
possible (see https://html.spec.whatwg.org/multipage/). XMLmind
Software is not responsible for these specs. We do not discuss them.
We just do our best to implement them.
If you are not willing to restrict what users are allowed to do, then
you really should look for other ways to solve the problem. You yourself
might have not seen the empty lines that we have experienced several
times, but you do not want anyone else to experience them either.
Note that almost all XML vocabularies have their quirks. This is not
specific to XHTML5. For example, DocBook allows a <table> to be a
direct child element of a <para>. Who would want this?
It works in quirks mode. And I happen to think it is meaningfull. But
that is another topic ...
Leif Halvard Silli
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support