dotMobimobiForgemobiReadyDeviceAtlasgoMobi
background image

Posted by nightsky - 16 Oct 2009

pic
 nightsky
mobiForge Newbie
Posts: 3
Joined: 5 years ago
[offline]

Validator at http://ready.mobi just failed on a site I'm developing, saying: "Your page does not use XHTML Mobile Profile". It also said it didn't validate. The site does use a valid mobile DTD:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">

and the markup is validating against the w3c validator.

Anyone have any ideas why this would fail?

Posted by garbetjie 5 years ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 6 years ago
[offline]

No idea why it would fail, but perhaps if you could post the markup, we could try to help debug it?

Posted by nightsky 5 years ago

pic
 nightsky
mobiForge Newbie
Posts: 3
Joined: 5 years ago
[offline]

Site is m.ikea.us. Technical review, including validation failure, described here:

http://www.ikeafans.com/home/ikeas-new-mobile-website-a-first-look/

Posted by garbetjie 5 years ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 6 years ago
[offline]

I know it's not much help, but with the limited testing I've been able to do, I'm dumbfounded. I would suggest trying to remove the <p class="copyright">&copy; Inter IKEA Systems B.V. 2009</p>, as the validator is complaining about something on line 72, and this snippet of markup is on that line.

I'd try removing that line, and seeing whether it then validates. If so, then there's something funky with that line. Else, it's something else...

Posted by ruadhan 5 years ago

pic
 ruadhan
dotMobi logo
Mobile Champion
Posts: 730
Joined: 8 years ago
[offline]

As Garbetjie has pointed out, ready.mobi tries to show where the errors are in validation. In your case the message is:

 FAIL near line 72 column 8
The content of element type "form" must match "(h1|h2|h3|h4|h5|h6|ul|ol|dl|p|div|pre|blockquote|address|hr|table|script|noscript|fieldset)+"

This means that it didn't like the content of your <form> element. Specifically, your page does not follow the DTD for the DOCTYPE you specify (XHTML MP1.2) - following a form element, you should use one of the tags listed in the error message above, i.e. everything inside your <form> tag should be wrapped in one of these elements.

To try to increase your score, I would try to get rid of this error and then revalidate (this may lead to further errors, but you can work on them as they appear)

Ruadhan O'Donoghue
Editor, mobiForge

Posted by ruadhan 5 years ago

pic
 ruadhan
dotMobi logo
Mobile Champion
Posts: 730
Joined: 8 years ago
[offline]

NOte also that your site does get similar errors in the W3C MobileOK tester:
http://validator.w3.org/mobile/check?task=200910201443126037&docAddr=http://m.ikea.us/

Ruadhan O'Donoghue
Editor, mobiForge

Posted by garbetjie 5 years ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 6 years ago
[offline]

Ruadhan, I'm a bit confused as to the error message being reported. In the W3c mobile validator, it states that the problem lies on line 74 column 8, which is the linie containing <div class="footerlinks">.

In the ready.mobi validator, it claims that the error lies on line 72 column 8, which is the line containing <p class="copyright">&copy; Inter IKEA Systems B.V. 2009</p>.

So, to bring it back to the original question (and to introduce another one): what could be causing the discrepancy in the reporting of the error's line number, and what is the validator actually finding issue with? Both <p> and <div> tags are allowed inside a form.

Have you ever encountered this before?

Posted by ruadhan 5 years ago

pic
 ruadhan
dotMobi logo
Mobile Champion
Posts: 730
Joined: 8 years ago
[offline]

In ready.mobi at least, the line numbers are only given as a clue to where the error is, hence the near line 72... The message is what is important.

The second thing I would say is that you must be careful that you are counting line numbers on the exact same markup that ready.mobi tested. Ready.mobi prints out the markup it tested near the bottom of the results page.

Looking at that output, lines 71-74 are:

71: </div> 
72: <!-- shell -->
73: </form>
74: </body>

This seems OK to me since the error message we received was about a <form> element (although you might have expected the line number to refer to the opening <form> instead of the closing one </form>) So if you forgive ready for being out by 1 line, although depends on whether you start counting at 0 or 1...;-) then it hasn't really been too far off the mark.

Back to the question, yes indeed, both <p> and <div> tags are allowed in the form, but the <input> tag directly inside the <form> tag looks like the culprit to me. Ready.mobi is saying that any tag within the <form> tag must be in this list, or wrapped inside one of the tags in this list, so:

<form....>
  <input ... />
</form>

is bad, while the following would be OK:

<form>
  <div>
    <input ..... />
  </div>
</form>

Does this make sense?

Ruadhan O'Donoghue
Editor, mobiForge

Posted by garbetjie 5 years ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 6 years ago
[offline]

ruadhan wrote:

<form....>
  <input ... />
</form>

is bad, while the following would be OK:

<form>
  <div>
    <input ..... />
  </div>
</form>

Does this make sense?

Yeah, that much makes perfect sense. What doesn't make sense to me though is the discrepancy between the markup I'm viewing, and the markup the validator is bringing back.

In the markup I'm viewing through my browser, there is no errant element - it is wrapped inside a element.

However, in the markup that the validator is bringing back, it seems as if it is stripping this wrapping . Is there some sort of empty-div-stripping that I'm not aware of?

Oh, and I have seen the validator's markup before. I was just too hasty in trying to find a solution to scroll down far enough :D I'll take my chastisement on the chin :P

Posted by nightsky 5 years ago

pic
 nightsky
mobiForge Newbie
Posts: 3
Joined: 5 years ago
[offline]

Thanks for all the responses.

Garbetjie, I also noticed the discrepancies between the validator's rejected code and my own (in view source). It turns out that .net actually generates different markup depending on client!

I'm looking into a way to shut this off. I am still shaking my head in disbelief.

Posted by garbetjie 5 years ago

pic
 garbetjie
Mobile Guru
Posts: 70
Joined: 6 years ago
[offline]

That's really annoying! But I'm glad you've found a possible solution :) I'll try it again at work tomorrow, but I'll go through and emulate the ready.mobi browser, just to be sure :)

Posted by ruadhan 5 years ago

pic
 ruadhan
dotMobi logo
Mobile Champion
Posts: 730
Joined: 8 years ago
[offline]

garbetjie wrote:


However, in the markup that the validator is bringing back, it seems as if it is stripping this wrapping . Is there some sort of empty-div-stripping that I'm not aware of?


nightsky wrote:


It turns out that .net actually generates different markup depending on client!

I'm looking into a way to shut this off. I am still shaking my head in disbelief.

Right, so .net is doing some device detection and sending ready.mobi something different.... you would think it would still try to send back valid markup! Can see how that would be stressful for you!

I think this may have come up in the forum before - not sure if there was a solution... I'll have a quick look...

Ruadhan O'Donoghue
Editor, mobiForge