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)

Date: 2007-03-20 09:53 am (UTC)
From: [identity profile] bellinghman.livejournal.com
Hmm, their example is valid according to what I see on the W3C site, but marked DEPRECATED.
  1. The </li> isn't required
  2. You can dump a sublist in without a <li>!
  3. lists will sometimes run backward!

Date: 2007-03-20 10:37 am (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
I'm not sure about number 2. Because you don't know where the implicity /li is going in you can't say that the sublist isn't in it really.

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.

Date: 2007-03-20 10:49 am (UTC)
From: [identity profile] bellinghman.livejournal.com
Ah, bugger.

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.

Date: 2007-03-20 10:52 am (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
I agree. The only time it should have been acceptable was for self closing tags like br and hr where a closing tag doesn't make sense. And even then it would have been nicer if they'd enforced making them self closing since if they'd introduced it at the beginning nobody would have had a problem with it. Damn them all. :)

Date: 2007-03-20 10:56 am (UTC)
From: [identity profile] bellinghman.livejournal.com
Aye.

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.

Date: 2007-03-20 10:52 am (UTC)
From: [identity profile] barnacle.livejournal.com
Their option is dead wrong. But your option may be failing because they might be doing DTD validation and I don't know enough DTD language to be sure that it's right. There's a condition that might mean that li elements can contain EITHER block content (div, p etc.) or inline content (plain text, span, label, b, i, em, a etc.) but not both.

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.

Date: 2007-03-20 11:08 am (UTC)
From: [identity profile] j4.livejournal.com
I'm pretty sure "%block;|%inline;" is either-but-not-both, BICBW (I haven't used SGML DTDs in anger since 2003).

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. :-(

Date: 2007-03-20 12:12 pm (UTC)
From: [identity profile] barnacle.livejournal.com
Me too. Do you think LiveJournal 0.2 will use something like wiki-ish?

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.

Date: 2007-03-20 12:27 pm (UTC)
From: [identity profile] j4.livejournal.com
Oh, arsebiscuits, sorry about LJ's HTML-eating, there; there really really needs to be a "verbatim" setting where nothing gets auto-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.

Date: 2007-03-20 11:20 am (UTC)
From: [identity profile] rgl.livejournal.com
I don't think wrapping it in a DIV will help: the definition of %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;.

Date: 2007-03-20 12:00 pm (UTC)
From: [identity profile] barnacle.livejournal.com
Yes, I know. "<li><div> fooItem 1> ... </ul> </div>", would be an option to get round the li's requirements, though. I don't know about the content in div: that might be "Flow" too.

Date: 2007-03-20 12:05 pm (UTC)
From: [identity profile] barnacle.livejournal.com
Rrgh. Bloody LiveJournal's halfway-house HTML comprehension nubbins bollocks ARGH.

Date: 2007-03-20 11:14 am (UTC)
From: [identity profile] jvvw.livejournal.com
Sounds very much like a bug in the CMS and that the CMS folk don't really know what they're talking about it. I'd try and raise it as a bug through whatever channels there are, explaining that their syntax isn't valid HTML citing the stuff you have here and then just accept that you'll probably have to workaround it (what CMS are you using out of curiosity?)

Date: 2007-03-20 11:19 am (UTC)
From: [identity profile] j4.livejournal.com
I'd try and raise it as a bug

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. :-/

Date: 2007-03-20 11:24 am (UTC)
From: [identity profile] rgl.livejournal.com
I'm pretty much positive that your version is right and theirs is wrong. I tend to use http://validator.w3.org to get a definitive answer on such things, though it only works with complete pages rather than fragments.

Date: 2007-03-20 11:38 am (UTC)
From: [identity profile] j4.livejournal.com
I've wrapped that fragment in a test page (http://www.chiark.greenend.org.uk/~janetmck/amirightornot.html) and you're right, it doesn't validate (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.chiark.greenend.org.uk%2F%7Ejanetmck%2Famirightornot.html&charset=%28detect+automatically%29&doctype=Inline).

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?

Date: 2007-03-20 12:06 pm (UTC)
From: [identity profile] barnacle.livejournal.com
"Can you clarify what you mean by valid, as this seems to fail on the W3C validation test server?"

"Clarify" is a great word for this situation.

Date: 2007-03-20 12:10 pm (UTC)
From: [identity profile] j4.livejournal.com
Magic - thank you!

(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.)

Date: 2007-03-20 12:59 pm (UTC)
From: [identity profile] barnacle.livejournal.com
Interestingly, I got that error from gcc only last week. Apparently your cock has to be UTF-8, and bend in the middle like a real cock should.

Date: 2007-03-20 02:43 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
UTF-8 cocks are also self-synchronizing, which is convenient.

Date: 2007-03-20 03:01 pm (UTC)
From: [identity profile] j4.livejournal.com
I'm not sure I'm following all this stuff about how UTF-8 cocks work... do you think you boys could show me?

Date: 2007-03-20 05:11 pm (UTC)
From: [identity profile] barnacle.livejournal.com
That's straight out of the ISO-8859-COCK codepage. In UTF-8 you'll need:

0xE2 B3 Image

Date: 2007-03-20 05:39 pm (UTC)
From: [identity profile] j4.livejournal.com
It's an optical illusion, right? I mean, they're actually both the same size.

Date: 2007-03-21 05:07 pm (UTC)
From: [identity profile] barnacle.livejournal.com
Yeah, when they're in use, but the second cock takes up more storage space while being in theory more portable across cockplementations.

It's one step in undoing the damage caused by the Tower of Cockle.

Date: 2007-03-20 11:56 am (UTC)
From: [identity profile] damned-colonial.livejournal.com
Web 0.2! I have to use that! *writes in biro on back of hand*

Date: 2007-03-20 11:58 am (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com

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".

Date: 2007-03-20 12:07 pm (UTC)
redbird: closeup of me drinking tea, in a friend's kitchen (Default)
From: [personal profile] redbird
You could send them back a note saying, as politely as you can manage, that the syntax you're entering and the CMS is refusing is valid HTML, and that their suggested fix is not good HTML, even though the CMS accepts it, as shown by the validator.

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.]

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. 26th, 2025 03:48 am
Powered by Dreamwidth Studios