Browsers XSLT handling when there are two xml-stylesheet PI

Discussion in 'XML' started by gdelfino@gmail.com, Mar 3, 2006.

  1. Guest

    I have an XML file which I transform into XHTML using stylesheetA.xsl.
    I also have stylesheetB.xsl which transforms my XML file into an Excel
    XML document.

    As both Excel and most new browsers have a built in XSTL engine, I
    decided to add the stylesheet information to the original XML file.
    Like this

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <?xml-stylesheet href="stylesheetA.xsl" type="text/xsl" media="excel"?>
    <?xml-stylesheet href="stylesheetB.xsl" type="text/xsl"
    media="screen"?>
    <blahblah>
    .... etc ...
    </blahblah>

    When I open the XML file with Excel, it asks me which of the two
    stylesheets to use, which is great.

    When I use Firefox 1.5.0.1 to open the XML file, it just uses the
    *second* stylesheet (stylesheetB.xls) without asking. So far so good.

    Internet Explorer 6, and Safari 2.0.3 use the *first* stylesheet (the
    wrong one) without asking.

    So, if I am to embbed the stylesheet information, I need to do it one
    way for Firefox, and in a different way for Internet Explorer and
    Safari.

    It seems to me that:

    1) Firefox should use the first stylesheet, like Intenet Explorer and
    Safari.

    2) The media attribute should be used to allow all applications know
    which stylesheet to use. I invented the media="excel", but I understand
    that web browsers should choose the stylesheet with the media="screen"
    attribute.

    Any comments?

    Regards,

    Gustavo Delfino
    Caracas, Venezuela
     
    , Mar 3, 2006
    #1
    1. Advertising

  2. Andy Dingley Guest

    On 3 Mar 2006 15:10:32 -0800, "" <>
    wrote:

    How about trying this:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <?xml-stylesheet href="stylesheetB.xsl" type="text/xsl"
    <?xml-stylesheet href="stylesheetA.xsl" type="text/xsl" media="excel"?>

    I'm guessing that Excel asks, Firefox looks at the media attribute and
    IE just grabs the first.
     
    Andy Dingley, Mar 4, 2006
    #2
    1. Advertising

  3. Guest

    If I do it that way, Excel asks, IE and Safari grab the first one, but
    Firefox incorrectly uses the second one.
     
    , Mar 4, 2006
    #3
  4. Guest

    , Mar 4, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=

    Stylesheet referanse i stylesheet

    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=, Jul 3, 2004, in forum: XML
    Replies:
    3
    Views:
    602
    =?ISO-8859-1?Q?J=F8rn_Tommy_Kinder=E5s?=
    Jul 4, 2004
  2. Michael Hertz
    Replies:
    3
    Views:
    10,352
    Martin Honnen
    Oct 4, 2004
  3. Steven An
    Replies:
    1
    Views:
    522
    Martin Honnen
    Nov 23, 2004
  4. David Blickstein
    Replies:
    3
    Views:
    1,066
    David Blickstein
    Aug 2, 2005
  5. David Blickstein
    Replies:
    14
    Views:
    6,412
    Harrie
    Oct 16, 2005
Loading...

Share This Page