XHTML disrupted by Mobile access

Screen shot of the XML error, lots of code.I’m not sure whether to put this down to an issue with my (mobile) ISP, or whether it should count against using XHTML sent as application/xhtml+xml? I’ve recently found that even a well authored site using valid XHTML can display as an XML error in browsers that support XML mime types.

The site was using Internet Explorer’s conditional comments to overcome some limitations in IE, and a reverse conditional comment for non IE browsers:

<!--[if !IE]> <-->                                                                                  
        <script type="text/javascript" src="scripts.js"></script>                            
<!--> <![endif]-->

Unfortunately, when sent over my mobile connection (Orange) the page is reformatted, even though I’m only using it as a modem. The file is stripped of line breaks, and that comment comes out as:

<!--[if !IE]><-->
  <script type="text/javascript" src="/scripts/basic.js"></script> 

Missing the close of the comment, the strict display mode triggered by the mime type means that only an XML style error message is displayed.

I guess this has to be added to the list of issues (such as user-added content) that makes an XML mime type difficult to manage?

14 contributions to “XHTML disrupted by Mobile access

  1. Actually, it looks more like a bug in the networks parser to me. Maybe it thinks the first > after <!-- immediately closes the comment and <--> is a tag whose name is “–” thinks. Or something.

    It would take a more expert eye than mine to guess what’s happened. Do they have a bug reporting address? They’ll know for sure what went wrong, since it’s their own system.

  2. Hi Ben,

    I’m not going to mess with WordPress’ comment system!

    I’ve emailed what I think is the appropriate address, I’ll add a comment if I get a reply back.

  3. Btw, just noticed your scrollable code boxes don’t work quite right in IE6. The third line is obscured by the horizontal scrollbar.

    Only way I’ve managed to make them work at all cross-browser is using overflow: scroll; with lots of padding. Even this has problems, like visible scrollbars when you don’t need them and Firefox doesn’t them disable correctly in single-line samples.

    The overflow: auto; would be much more elegant..if only it was supported.

    Can’t wait ’till we can drop support for IE6!

  4. I might be able to use an IE only overflow-x or y rule to get over it, I’m using a conditional comments style sheet.

    Slight worse, I’ve just noticed a bug in IE7 (possibly 6) where the first paragraph extends under the navigation bar at certain screen widths. Something to do with the fixed width code item and floated image?

  5. I’d still like to understand the problem.

    Anyway, I got this from Orange:

    For further assistance regarding this matter, please call our Wirefree Data Services Department on 156 from your Orange phone … a Representative will be able to assist you in this matter.

    Kind regards

    Orange Customer Services

    I’ll give them a ring later.

  6. Did they answer?

    You might find overflow-x: scroll; does what you are looking for.

    I use overflow-y: scroll; in Firefox’s userContent.css file so I always have a vertical scrollbar which disables correctly when there’s nowhere to scroll.

    IE seemed to respond to the scroll value better than the auto value when I was doing Project Cerbera’s boxes. I might play with this today because, much like yourself, I like to understand problems too. Even if I can’t find a solution. 🙂

  7. Project Cerbera now uses overflow-x: scroll; because it works the same in IE6 and Fx2. O9 doesn’t apply it.

    Declaring overflow: auto; with overflow-x: scroll; and overflow-y: visible; below it might work better.

    I’m not losing sleep over it, though.

  8. Sorry about that, not sure how to adjust that in WordPress.

    Regarding the validity, I don’t beleive that it uses double dashes except as comment open/closes, so I don’t think it’s invalid (although thanks for the link).

    Unless it’s invalid to have the greater/less than signs next to the double dash? I cut and paste that code into the validator and it didn’t complain, so unless there’s a bug in that, it seems valid (except for the one mangled by the network, obviously).

  9. Sorry, I read the example wrong. You could try putting arbitrary text at the end, like
    <!—[if !IE]> —>

    <!—a> —>

    Wow, I have never considered the effects that sort of compression for mobile devices would have on pages…

Comments are closed.