This is an ex-HTML
Mar. 20th, 2007 09:16 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Okay, I think I'm going mad. I put the following into our CMS:
<ul>and it (silently, without any notification) 'corrected' it to the following:
<li> Item 1
<ul>
<li> SubItem 1</li>
<li> SubItem 2</li>
</ul>
</li>
<li> Item 2</li>
</ul>
<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:
<li>Item 1
<ul></ul></li>
<li>SubItem 1</li>
<li>SubItem 2</li>
<li>Item 2</li></ul>
"Could you please use the following schema: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.
<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."
no subject
Date: 2007-03-20 09:48 am (UTC)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)
no subject
Date: 2007-03-20 09:56 am (UTC)* I'm not saying that it's an authoritative source, but.
no subject
Date: 2007-03-20 10:10 am (UTC)http://www.w3.org/TR/html401/struct/lists.html#h-10.2
no subject
Date: 2007-03-20 10:13 am (UTC)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)
no subject
Date: 2007-03-20 09:53 am (UTC)no subject
Date: 2007-03-20 10:37 am (UTC)Certainly my reading of the usage at http://www.w3.org/TR/html401/struct/lists.html#edef-UL implies to me that ULs and OLs may only contain LIs and that LIs may contian any flow type stuff (which would include ULs and OLs). I don't think there is a valid deprecated usage where a UL or OL could be in another one of them without being inside an LI as well.
no subject
Date: 2007-03-20 10:49 am (UTC)The deprecated example has omitted </li>, so the sublist is effectively within a <li>. Which just goes to show that omitting close attribute tags is stupid and should always have been banned.
no subject
Date: 2007-03-20 10:52 am (UTC)no subject
Date: 2007-03-20 10:56 am (UTC)Hence the distinction between 'attribute' tags (forgive me if I don't use correct terminology here) and br. And hr, which I didn't remember.
<br/> style self-closing would have been good, too, but I can understand them not getting that first time round.
no subject
Date: 2007-03-20 10:52 am (UTC)http://www.w3.org/TR/html4/sgml/dtd.html
states:
<!ENTITY % flow "%block; | %inline;">
...
<!ELEMENT LI - O (%flow;)* ...
The dash and the O means that the opening LI tag is required and the closing is optional. That seemss ambiguous depending on your SGML parser's behaviour and how it treats the binding there. As I say, I don't speak DTD or SGML well enough, but that could be interpreted as "any number of either-block-or-inline elements" or "either any number of block elements or any number of inline elements."
The schema also may be tight: http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd creates a complexType called Flow which can be any one of four choices. I think choice means it has to be a single one of them, but then that one can occur multiple times. So multiple elements from the block or inline groups, but not a mixture.
Try wrapping everything within the LI in a DIV and see where that gets you.
no subject
Date: 2007-03-20 11:08 am (UTC)The CMS claims that what it's producing is XHTML. <html xmlns="http://www.w3.org/1999/xhtml">
is block, not inline - isn't it? - so I'm not sure why wrapping the
in an- inside a
would be different. Or am I missing your point? I'm getting increasingly confused here. :-(
no subject
Date: 2007-03-20 12:12 pm (UTC)If %flow; is %block;|%inline;, then it's either but not both. But then what does (%flow;)* mean, which is the content of LI elements? Does it mean lots of block XOR lots of inline, or does it mean lots of things, each of which can either be block or inline? My answer is a shrug.
It seems that DTD and schema validation could produce different results with your version. Given that in the schema Flow is an extension of a complexType (which can contain #PCDATA), then yours should work there; in the DTD (%flow;)* might match something that itself matches %inline;%block;, or it might not.
no subject
Date: 2007-03-20 12:27 pm (UTC)interpretedbollocksed. (I suppose the standard OSS answer applies: if I want it, I should write it rather than whinging.) Did what I said make any sense in the email notification?Coming back to yer blocks/inlines, I am pretty sure (after some hasty revision of what SGML knowledge I used to have) that %block;|%inline means one-or-more block XOR one-or-more inline.
no subject
Date: 2007-03-20 11:20 am (UTC)%inline;
includes#PCDATA
, which makes it a Mixed Content Model and means you can have text arbitrarily intermingled with the various options specified in the definition of%inline;
.no subject
Date: 2007-03-20 12:00 pm (UTC)no subject
Date: 2007-03-20 12:05 pm (UTC)no subject
Date: 2007-03-20 11:14 am (UTC)no subject
Date: 2007-03-20 11:19 am (UTC)I'd feel much more confident about doing that if my readership had reached a consensus on whether the auto-corrected version and/or the suggested correction were correct or not. :-/
what CMS are you using out of curiosity?
Sitecore (http://www.sitecore.com/). It's probably very nice if you want something that looks/feels like Windows XP and which doesn't require you to see any of those nasty angle-brackety things. :-/
no subject
Date: 2007-03-20 11:24 am (UTC)no subject
Date: 2007-03-20 11:38 am (UTC)Now, how do I go about telling software developers who are senior to me (and who know I'm not in a "technical" role) that they're wrong?
no subject
Date: 2007-03-20 12:06 pm (UTC)"Clarify" is a great word for this situation.
no subject
Date: 2007-03-20 12:10 pm (UTC)(I'm afraid all my politeness generators are out of whack at the moment, as a bug in the code means that they convert everything to "AGGGGHHHHHH! COCKING COCKMONSTERS!" - which is formatted correctly.)
no subject
Date: 2007-03-20 12:59 pm (UTC)no subject
Date: 2007-03-20 02:43 pm (UTC)no subject
Date: 2007-03-20 03:01 pm (UTC)no subject
Date: 2007-03-20 03:40 pm (UTC)no subject
Date: 2007-03-20 05:11 pm (UTC)0xE2 B3
no subject
Date: 2007-03-20 05:39 pm (UTC)no subject
Date: 2007-03-21 05:07 pm (UTC)It's one step in undoing the damage caused by the Tower of Cockle.
no subject
Date: 2007-03-20 11:56 am (UTC)no subject
Date: 2007-03-20 11:58 am (UTC)You're right that their suggestion is broken; UL contains one or more LI but not another nested UL. (The same rule makes the empty UL illegal, too.) It sounds like their software has a completely broken model of UL.
Given the syntax they suggest is invalid, presumably browsers are allowed to do anything they like with it, so any possible choice of eventual displayed output would be "formatted correctly".
no subject
Date: 2007-03-20 12:07 pm (UTC)It may fit some local DTD, but HTML is not SGML, and you presumably are working on something that will be seen by outsiders and run through browsers that don't have your DTD.
[It's too early in the morning for me to find the politic phrasing; some mention of the fact that you know they didn't create the CMS might help.]