Okay, now the following worked in IE6 for me. It requires that the document be served as XML and it uses an XSL stylesheet to make IE read it as HTML.
The file 'xhtml.xsl' has the content: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> And the xhtml document, which needs to be served as application/xml or text/xml, reads: <?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="xhtml.xsl" ?> <?xml-stylesheet type="text/css" href="test.css" ?> <!DOCTYPE xhtml [ <!ENTITY style SYSTEM "test.css"> ]> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:lang="en" > <head> <object id="AdobeSVG" classid="clsid:78156a80-c6a1-4bbf-8e6a- 3cd390eeb4e2"></object> <?import namespace="svg" implementation="#AdobeSVG" ?> <link rel="stylesheet" type="text/css" href="test.css" /> </head> <body> <svg:svg class="svg" width="45px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg"> <svg:defs> <svg:style type="text/css"> &style; </svg:style> </svg:defs> <svg:rect id="rect" x="5" y="10" width="40" height="30" /> </svg:svg> </body> </html> We need IE to read it as XML so that the external entity reference to the css file will be parsed. Then you only need to add an svg:style element containing the entity reference "&style;" to each inline SVG. It's a bit of additional work, but then changes to the stylesheet can be made centrally. After parsing the document as XML we use IE's XSLT support and just copy the whole document. That's all the XSL file does. But this way we make IE interpret the output as HTML. It's not really cross platform yet. Opera gets a CSS error because the entity reference is not expanded, but the document is still displayed correctly because the stylesheet processing instruction is sufficient for Opera. --- In [email protected], "panic4217" <[EMAIL PROTECTED]> wrote: > > Thanks for your reply! > > --- In [email protected], "Frank Bruder" <redurbf@> wrote: > > > Well, I wouldn't have expected your approach to work because: How > > would IE know that the stylesheet processing instruction is to be > > handed to ASV? And there doesn't seem to be a way to do this. > > I don't know the inner workings of IE7 or ASV, but conceptually, > I don't see why stylesheet information could not be passed on to > plugins. > > > I tried placing the stylesheet in an svg:style element inside the > > svg:svg element. I thought if this would work then using an external > > stylesheet might be possible by using external entities or something > > like that. But I didn't even get an internal stylesheet to work. > > And to my astonishment, even the use of the style attribute directly > > at svg: elements did not work in IE+ASV. So all I can say is that CSS > > for inline SVG in IE is even more of a problem than I had expected. > > Fiddling a lot, I finally succeeded in placing a stylesheet in > the svg: > <svg:svg ...>... > <svg:defs> > <svg:style type='text/css'> > rect { fill: red } > </svg:style> > </svg:defs> > ... > </svg:svg> > > This worked. However, experimenting I came across numerous > variations that strangely did not work: > > * removing the <?xml-stylesheet ...?> processing tag at the > top of the XHTML document would break IE7+ASV > > * enclosing the stylesheet in <![CDATA[ ... ]]> would break > IE7+ASV. How do we then insert a stylesheet using '>' > selectors and still produce XML? > > * rect.X in the stylesheet would not work in IE7+ASV for > rect tags with class="X", nor would rect[class="X"]. However, > rect[cls="X"] would work for rect tags with cls="X", and > rect#1234 would work for rect tags with id="1234" !?! > > > In case that works, you could try > > external entities or XSLT to include an external stylesheet. > > Sorry, I don't understand what you mean here. I tried briefly > using @import "http://..." in the inlined stylesheet, but that > did not seem to work for me. > > > Otherwise, maybe there is some way to make IE hand on a processing > > instruction to ASV or maybe there is some way to set a stylesheet for > > ASV with a param element inside the object node in the head. There is > > quite a lot of things which can be done in IE but are not well known. > > This would really be nice. As it is now, you cannot change a > style option in a centrally located style file (and I guess the > user cannot set his own style file to override styling). > > > Regarding your question: What are you doing wrong? > > > > My answer would be: You're using the wrong browser. > > I could not agree more! Please convince the vast number of IE > users to act on this fact. ;-) > > > If you really need to support IE then I would suggest either to embed > > external SVG files by reference > > I would like to avoid this, as I am using online generated XHTML > documents and would like to inline to avoid caching issues etc. > > But thanks for all your help! Now I have a somewhat working > solution for Inferior Explorer 7. > > -- Arne > ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

