Re: Reinstating XHTML-IM (XEP-0071)

Stephen Paul Weber <[email protected]> Sun, 15 Mar 2026 15:22:19 -0500
Newsgroups gmane.network.jabber.standards-jig
Message-ID <[email protected]>
>This is not correct. HTML5 HTML syntax allows for self-closing tags in
>foreign elements (e.g. when having an svg embedded directly in the
>document), it does not allow for self-closing tags for HTML void
>elements (those that don't have a closing tag, like <img>), raw text or
>normal elements (which have mandatory closing tags).

This is not correct. The HTML5 specification, 13.1.2.1:

> Then, if the element is one of the void elements, or if the element is a 
> foreign element, then there may be a single U+002F SOLIDUS character (/), 
> which on foreign elements marks the start tag as self-closing. On void 
> elements, it does not mark the start tag as self-closing but instead is 
> unnecessary and has no effect of any kind.

It "does not mark the start tag as self closing" of course because in an 
HTML parser context the element is inherently self closing and needs no such 
mark. But the syntax is explicitly supported here.

>However if you do <img src=foo.png/> (which is valid in
>HTML, but not XML) the '/' actually becomes part of the 'src' attribute
>value, meaning that the file 'foo.png/' is used as src.

Yes. This unfortunate edge case is mentioned also in the spec, however if 
using well-formed XML it is fortunately not possible to run into it.

>For normal elements where a closing tag is mandatory, the unnecessary
>empty '/' attribute works the same, meaning the HTML parser is still
>waiting for the closing tag after a seamingly self-closed element. As
>an example <div><strong />Hey</div> will render "Hey" in bold when
>parsed as HTML (because the strong is not closed), but not when parsed
>as
>XHTML. https://gist.github.com/mar-v-in/7aa612d173d02240b7d2124c18670ec3
>is an example file, which when you save it with .html ending and open
>it in a browser, it will make the last line bold, if you rename the
>file to .xhtml, the last line won't be bold - because the file ending
>is translated to an appropriate MIME type and the XML parser is
>triggered. I reproduced this on both Firefox and Chromium and it
>matches the specification.

Yes sure, old XHTML mime type had all kinds of extra things like this and 
that's part of why people got grumpy about it.

>Anyway, I still haven't heard of the features and functionality that
>people aim to get by reinstating XHTML-IM that XEP-0394 couldn't
>provide as well or even better.

XEP-0394 is a non-starter for me. An attempt to re-invent HTML ourselves 
with character ranges instead of markup? An attempt to do markup in XML 
without resorting to... actually using markup?  If anything as I said in my 
first post the existence ofr 0394 in experimental shows that there is a 
desire for a stable standard for rich text in XMPP using XML, and indeed we 
already have a much better one in XHTML-IM.

_______________________________________________
Standards mailing list -- [email protected]
To unsubscribe send an email to [email protected]
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEWeaCw+rzmiEMpzU00RwpEc5RnN4FAmm3FPsACgkQ0RwpEc5R
nN65uxAAglPEZLEICgAn/rwQyShwVjvEPx9+5oSITz1aeltokHdTB/oOjid/4t9T
KGpq15ZOXdss2RfYVlBeXT55ufKn0RUpSDmy71xtx+VeKRt/RxjNVIFX+W+ZpZ2C
/HdlgQXfc/nwkGD4++M+LTm9Kp1jPik+ulrUdjq8MSogqgze6p7l+YUue9/eesvy
MJPHNZEcTN4ehFNhKmwlRRQ0si/CHGnbpgrPj0ST9y/70E2BYrVR+W9Dx5Dw7pyJ
UfCYyLjOCL5ameSJlSWJ/Wv3+f5gKDEzkB682a4sUywq7MfuRQj5YMbmyCJGYWys
Nqn4DOr0qM/zt53n1K2l0Yq+DOUcNXUPSh4KJP+h/K8jdvDOLCPVgxvao05x4nCr
4JN0sH+r10zxS58c/rNTlCtf5r8Iz5/o2ZSzREhziAoZIBifgC4uv4BaBb8r0k4D
KRbc5SkVSWIsr0S/taN51y/OXbCDMV02XvwWRbNvvcngZSChfYwuCemiwhLf8vFR
NmMXr1VYBrXBMVZBIJnMWFkaWMcUPKNGEWxeWJycdlerrghPN9/ZPWaCNPaxaxAp
G96fKSf1Qe4/r/OzRVFNHjM9L0f6gDjzcuGa8Gkcs1fwX/iiGxggZB7voOQjebqy
JGXYptpvGGfmwoOwu9kQUo4VbVhL14KZhekQVObnrvST5uMtXkU=
=OXrz
-----END PGP SIGNATURE-----