The reason you get different result is that IE cannot really display XML. It
treats it as an HTML element where non html elements are treated as IE
custom html tags. Try the following code in IE and click the button and
you'll notice how it converted your document to an HTML document with a head
and body :-( (It even converted the stylesheet pi to an html link element).
This problem is not something that MS will fix for IE6 so the problem is
going to be around for a at least two more years :-(

IE (5, 5.5, 6)

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<?xml-stylesheet type="text/css" href="#css"?>
<document>
 <style id="css">
  {}
  style {display:none;}
  document {display:block;background-color:#3080af;}
 </style>
 <contents>
 Hello, World!
 <button xmlns="http://www.w3.org/1999/xhtml"
onclick="alert(document.documentElement.outerHTML)">Dump Tree</button>
 </contents>
</document>

You could add the following rule for IE.

html\:html {background: red;}

Not perfect but at least it allows you to find the root element in ie.

erik arvidsson
webfx.eae.net

"Andy Sy" <[EMAIL PROTECTED]> wrote in message
TCSB6.65412$[EMAIL PROTECTED]">news:TCSB6.65412$[EMAIL PROTECTED]...
> In Opera the following CSS formatted XML doc:
>
> <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
> <?xml-stylesheet type="text/css" href="#css"?>
> <document>
>  <style id="css">
>   {}
>   style {display:none;}
>   document {display:block;background-color:#3080af;}
>  </style>
>  <contents>
>  Hello, World!
>  </contents>
> </document>
>
> displays the proper bluish background color for
> the _entire page_ if and ONLY IF the 'document''s
> display property for it is set to block.  Otherwise
> only the background of the elements within document
> is set to the proper color.  For Mozilla this isn't
> necessary.  IE 5 is much more strict in its
> interpretation of this which you can test out by
>
>     document {display:block;background-color:#3080af;}
>
> with display set to block vs inline.
>
> For IE, you will need to use the style
>
>     * {background-color:#3080af;}
>
> to set the page background.  Ironically, it is lax
> here compared to Opera for which you to need to
> define display:block for this style to color the
> whole background.
>
> The only style that will work unchanged across
> all three browsers is
>
>     * {display:block;background-color:#3080af;}
>
> However... it is unacceptable because it has the nasty
> side effect of somehow rendering later 'display:inline'
> property settings useless (interestingly, this behaviour
> is consistent among all three browsers)!!!!
> There seems to be no getting around the fact that
> you have to use 2 styles to ensure that your page
> background is set to a certain color.  One for the *
> selector (and without setting the display property to
> anything) and one for the root element selector.
> Sighh...... the days of kludges will always seem to be
> with us... :-(
>
>
>
>



Reply via email to