Re: [xsl] question on support of stylesheet embedding

Subject: Re: [xsl] question on support of stylesheet embedding
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Sun, 24 Jan 2010 02:37:14 +0100
> It does not look like that is supported with IE. IE 8 when I try your
> test case http://www.stamm-wilbrandt.de/en/xsl-list/cdcatalog.xml seems
> to sniff the content and try to interpret it as text/html meaning you
> end up with a browser window displaying the contents of the first title
> element in the window bar and a table with only the header row as the
> contents of the document followed by any text nodes in all those unknown
> (to the HTML parser) elements like artist, country.

Yes, stylesheet embedding is not supported for IE6/7/8.

But I found a work around -- stylesheet "ApplyEmbeddedStylesheetIE.xsl"
allows IE browsers to process embedded stylesheets!

The stylesheet may be found here:
http://stamm-wilbrandt.de/en/xsl-list/ApplyEmbeddedStylesheetIE.xsl

The first comment of that stylesheet explains how this works:
<!--

  ApplyEmbeddedStylesheetIE.xsl (1/24/2010)

  Thread "[xsl] question on support of stylesheet embedding":

http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list/archives/200907/msg00144.html
  identified IE6/7/8 browsers being unable to process embedded stylesheets.

  While Firefox always selects the last xml-stylesheet PI the
  IE browsers always select the first one;
  this allows for a browser switch on xml-stylesheet PI level.

  Results in NO performance penalties for Firefox and enables
  IE browsers for processing embedded stylesheets.

  Samples for embedded stylesheets enabled for IE by this stylesheet:
    http://stamm-wilbrandt.de/en/xsl-list/cdcatalogIE.xml
    http://stamm-wilbrandt.de/en/xsl-list/chess/board5bIE.xml

  The first xml-stylesheet PI href points to this stylesheet for IE.:
  The last xml-stylesheet PI href references the embedded stylesheet id.
  [use view (Page) Source in browser to inspect XML files]

  Having an absolute href for the first xml-stylesheet PI allows for
  copying around of XML files with embedded stylesheets while still
  allowing them to be rendered by Firefox and IE browsers anytime.
-->


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Developer, XML Compiler
WebSphere DataPower SOA Appliances
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


                                                                           
             Martin Honnen                                                 
             <Martin.Honnen@gm                                             
             x.de>                                                      To 
                                       xsl-list@xxxxxxxxxxxxxxxxxxxxxx     
             07/15/2009 06:14                                           cc 
             PM                                                            
                                                                   Subject 
                                       Re: [xsl] question on support of    
             Please respond to         stylesheet embedding                
             xsl-list@xxxxxxxx                                             
              lberrytech.com                                               
                                                                           
                                                                           
                                                                           
                                                                           




Hermann Stamm-Wilbrandt wrote:

> the spec says that embedding a stylesheet into a XML document is
possible:
> http://www.w3.org/TR/xslt#section-Embedding-Stylesheets
>
> After some searching I was able to get the cdcatalog sample below
working:
> (http://www.stamm-wilbrandt.de/en/xsl-list/cdcatalog.xml if you want to
> click).
>
> But it is working for Firefox 2/3 and Opera 9.64, NOT for MS IE6.
> I found neither negative nor positive statements on IE 6/7/8 support
> of stylesheet embedding while searching the web.
>
> Does anybody now the answer whether any of the Microsoft browsers
supports
> stylesheet embedding?

It does not look like that is supported with IE. IE 8 when I try your
test case http://www.stamm-wilbrandt.de/en/xsl-list/cdcatalog.xml seems
to sniff the content and try to interpret it as text/html meaning you
end up with a browser window displaying the contents of the first title
element in the window bar and a table with only the header row as the
contents of the document followed by any text nodes in all those unknown
(to the HTML parser) elements like artist, country.


--

             Martin Honnen
             http://msmvps.com/blogs/martin_honnen/

Current Thread