j4: (dodecahedron)
[personal profile] j4
Okay, I think I'm going mad. I put the following into our CMS:
<ul>
<li> Item 1
<ul>
<li> SubItem 1</li>
<li> SubItem 2</li>
</ul>
</li>
<li> Item 2</li>
</ul>
and it (silently, without any notification) 'corrected' it to the following:
<ul>
<li>Item 1
<ul></ul></li>
<li>SubItem 1</li>
<li>SubItem 2</li>
<li>Item 2</li></ul>
I pointed this out to the people who are setting up the new site for us, and they raised it as a support call with the CMS people, and got the following response:
"Could you please use the following schema:

<ul>
<li>Item 1</li>
<ul>
<li>SubItem 1</li>
<li>SubItem 2</li>
</ul>
<li>Item 2</li>
</ul>


Such syntax is formatted correctly."
If such syntax is formatted correctly, why doesn't it validate? I'm not even trying to be a validation Nazi about this (it's not as if anything that comes out of this CMS is ever going to validate anyway), it's more that I don't really want to have to 'correct' all our existing HTML to prevent it being 'corrected' by the CMS.

Date: 2007-03-20 09:48 am (UTC)
From: [identity profile] stephdairy.livejournal.com
I don't see why their option shouldn't validate. Both it and your original version are valid HTML 4 (though only theirs is also valid XHTML).

Their CMS's behaviour is reminiscent of that of LJ's HTML "fixer" which spews out a load of close tags for any elements you may have forgotten to close at any point in the rest of the document...

I'd say this "miscorrection" is a bug in the CMS, unless the CMS is expecting to deal with XHTML.

(S)

Date: 2007-03-20 09:56 am (UTC)
From: [identity profile] j4.livejournal.com
Okay, now I'm even more confused. Is this article (http://www.w3schools.com/xhtml/xhtml_html.asp)* just fibbing when it says that a nested list like my original is 'correct' for XHTML? (NB my example does close the <li> for Item 1, after the <ul> which it contains.)

* I'm not saying that it's an authoritative source, but.

Date: 2007-03-20 10:10 am (UTC)
fanf: (Default)
From: [personal profile] fanf
I agree with you and the article you link to. The HTML 4.01 DTD says that the only elements allowed within an <ol> or <ul> are <li>, so nested lists have to go within list items.

http://www.w3.org/TR/html401/struct/lists.html#h-10.2

Date: 2007-03-20 10:13 am (UTC)
From: [identity profile] stephdairy.livejournal.com
No, I just misread your example. Perhaps I should just shut up until I've drunk my coffee.

The HTML 4.01 Strict DTD allows LI to contain almost anything, including UL. (Curiously I can't see anything that allows a UL to contain another UL or OL, but see my comment about coffee...)

(S)

June 2025

S M T W T F S
1234567
891011121314
15 161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 27th, 2025 02:53 pm
Powered by Dreamwidth Studios