Anne van Kesteren

Upcoming redesign and xml-stylesheet testcase

The reason there wasn't a post here yesterday was because I was working on the redesign of this site. With this new design Netscape Navigator 4.x will not crash on my CSS anymore (it crashes on the CSS, strange isn't it?) and it will look a lot prettier, since Arthur designed the site and not me (this site is entirely my job! :p).

I also replaced CSS3 selectors like ::before with :before since that is still possible. Although I changed that this site will still have a CSS3 link, since I use a substring matching attribute selector in my print style sheet and I'm still looking for a nice way to implant :target. I dropped :empty, since I don't need that one anymore.

The markup is also changed. It takes 2 divs less in the upcoming the design (somewhere next week) and I'm still trying to make a discission between img, object or background-image, although the second might not be an option anymore: Plugins & <object> - Illegal?

The last thing (and probably most interesting) is that I made a xml-stylesheet testcase. Testcase no longer available. Mozilla seems to support it. If everything goes correct the p element has a red color and background image with the text: PHP POWERED. And if it goes perfect you see the following in the source:

<?xml-stylesheet href="screen.css" type="text/css"?>

Only browser who have application/xhtml+xml specified in their "accept header" will get this style sheet linking. So the validator won't get it for example. Since it does work in Mozilla 1.5b I think I'm going to use this technique when the new weblog goes online.

Comments

  1. Anne,

    [..] Only browser who have application/xhtml+xml specified in their "accept header" will get this style sheet linking. So the validator won't get it for example.[..]

    I don't get that. Why?

    I have tried something similar with your testpage, but sending it as application/xhtml+xml to the W3C Validator as well. It works just fine.

    You might take a look at test and test [source].

    Please forgive me, I am no php-expert, so the scripting is a little bit so-so ;)

    Posted by Minz Meyer at

  2. As I said before here, you can send it to the W3C HTML validator, the W3C CSS validator, the WDG validator, Opera 6, and Opera 7 as well. I don't know of any UAs stupid enough to pretend to be one of those.

    Posted by Sean at

  3. @Minz Meyer, the W3C validator does validate, but it doesn't validate my example as application/xhtml+xml, but as text/html.

    @Sean, I could take a look at that, but I'm not really happy when it comes to browser sniffing.

    Posted by Anne at

  4. You can look in $_SERVER['HTTP_USER_AGENT'] for Opera/6, Opera/7, WDG_Validator, W3C_Validator, and W3C_CSS_Validator to achieve that.

    Posted by Sean at

  5. You can look in $_SERVER['HTTP_USER_AGENT'] for Opera/6, Opera/7, WDG_Validator, W3C_Validator, and W3C_CSS_Validator to achieve that.

    Just as I wanted to show in my example ;)

    Posted by Minz Meyer at

  6. Thanks Meyer, I must confess I didn't look at your example the first time. Now I am going to use it :). Maybe the only thing you should do is differentiate the Opera versions. Opera 5 supports standards quite well, but doesn't support the MIME type.

    Besides that there seems to be some problems with Opera6 on other platforms: MIME type tests.

    Posted by Anne at

  7. I'm moving to this as well, but I only sniff for Opera 7. I think I'll add the W3C Validator as well.

    Posted by Ben at

  8. Besides that there seems to be some problems with Opera6 on other platforms[...]

    What problems? It matches CSS selectors incorrectly, but I don't have a problem with that because mine are all lowercase.

    Posted by Sean at