[sword-devel] trying to get proper xhtml to work in webkit

Greg Hellings greg.hellings at gmail.com
Fri Apr 17 08:43:10 MST 2020


On Fri, Apr 17, 2020 at 6:33 AM Karl Kleinpaste <karl at kleinpaste.org> wrote:

> On 4/16/20 11:08 PM, Greg Hellings wrote:
>
> <!DOCTYPE html> will give you HTML 5, not XHTML. XHTML would be much
> wordier:
> https://en.wikipedia.org/wiki/Document_type_declaration#XHTML_Basic_DTDs
>
>
> Well... That link itself says:
>
> In XHTML5 <https://en.wikipedia.org/wiki/XHTML5> the DOCTYPE must be a
> case-sensitive match of the string "<!DOCTYPE html>".
>
> So I'm already confused. Didn't take much, huh?
>
> - begins with <?xml...> line
>>
>
> Doesn't seem to be strictly needed by browsers for XHTML rendering, but it
> shouldn't hurt, either.
>
> I used it based on the examples seen at
> https://www.crosswire.org/pipermail/sword-devel/2019-March/046664.html
> which I saved at the time and used as a reference now.
>
> - changes content type to application/xhtml+xml (also tried just xhtml, no
>> diff)
>>
>
> That's not necessary to get you into XHTML mode.
>
> OK, keep that thought in mind -- now, ready for my next confusion? Here
> goes:
>
>  They only thing they care about is the Content-Type: in the HTTP header.
> Of course, you don't have an HTTP header, but surely you have a way to set
> it to "application/xhtml+xml"?
>
> See, on the one hand you say "not necessary" but in your next breath you
> say it's "the only thing they care about." OK, which is it?
>
> There has been this "meta" directive in the header to induce general
> HTMLness via content-type since years before I got involved, and I've never
> touched that particular aspect of it until now.
>
> Trust me, I remain wide open to suggestions, but just in your one response
> here, you've given me 2 completely self-contradictory indications, one
> about DOCTYPE and one about content-type.
>
> Small wonder people have trouble writing code to deal with this, I guess.
>

I think the confusion comes from me mixing my response. Discussion of
proper DOCTYPE and the necessity of the <?xml version="1.0" ?> directive
are about what makes a valid XHTML document

But, as I read more, I came to find that the HTML WG suggests, and
apparently all browsers implement, ignoring those directives and instaead
caring only about the Content-Type header/directive. So if you have that
header/directive in Xiphos, then try updating that to the appropriate
"application/xhtml+xml" and see if that fixes Xiphos/WebKit's behavior?

--Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20200417/0ff68353/attachment-0001.html>


More information about the sword-devel mailing list