xalan versus ie xml rendering

Discussion in 'XML' started by Andy, Feb 25, 2011.

  1. Andy

    Andy Guest

    Hi,

    This is related to a post made by me awhile ago. I have an xhtml file
    as follows:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?><html
    xmlns="http://www.w3.org/1999/xhtml" xmlns:eek:ps="http://www.idpf.org/
    2007/ops" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://
    www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance">
    <head>
    <title>The Game On! Diet</title>
    <link href="pdlmsr.css" rel="stylesheet" type="text/css"/>
    <meta content="application/xhtml+xml; charset=UTF-8" http-
    equiv="Content-Type"/>
    <meta name="Adept.resource" value="urn:uuid:312d0c9f-a6fc-4254-b4ac-
    c85aad71156f"/>
    </head>
    <body style="margin-top: 0px; margin-left: 0px; margin-right: 0px;
    margin-bottom: 0px; text-align: center; background-color: #FFFFFF;">
    <div class="centerImage1"><svg:svg height="100%" viewBox="0 0 1200
    1600" width="100%"><svg:image height="1600" transform="translate(0 0)"
    width="1200" xlink:href="Images/cover.jpg"/></svg:svg></div>
    </body>
    </html>

    As you can see, it uses some schema that knows what an svg:image is,
    and the result is to display an image this way without the img tag.

    In firefox, if I give this file the extension xhtml, it displays
    fine. But IE doesn't like rendering xhtml. Someone out there found
    that you can get IE to render this page correctly by sending the
    document with mime neither as html or as xhtml but as application/
    xml. Then you add this to the document header:

    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="/mywebapp/iexhtmlfix.xsl"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/epub/xslt/
    xhtml1-strict.dtd">

    Where iexhtmlfix.xsl is:

    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/1999/xhtml" version="1.0">
    <xsl:eek:utput method="xml" encoding="utf-8"/>
    <xsl:template match="/">
    <xsl:copy-of select="node()"/>
    </xsl:template>
    </xsl:stylesheet>

    Then IE loads the page being told its xml, but displays the correct
    image using the svg:image tag.

    Is it transforming to html? Wondering how this works. What I would
    like to do is find a way to do the same xsl transformation offline (or
    in a servlet engine) using apache xalan, but when I tried, my result
    still had the svg:image tag.

    Is there a way to resolve this to the equivalent html?

    Thanks,
    Andy
     
    Andy, Feb 25, 2011
    #1
    1. Advertising

  2. Andy wrote:

    > This is related to a post made by me awhile ago. I have an xhtml file
    > as follows:
    >
    > <?xml version="1.0" encoding="UTF-8" standalone="no"?><html
    > xmlns="http://www.w3.org/1999/xhtml" xmlns:eek:ps="http://www.idpf.org/
    > 2007/ops" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://
    > www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    > instance">
    > <head>
    > <title>The Game On! Diet</title>
    > <link href="pdlmsr.css" rel="stylesheet" type="text/css"/>
    > <meta content="application/xhtml+xml; charset=UTF-8" http-
    > equiv="Content-Type"/>
    > <meta name="Adept.resource" value="urn:uuid:312d0c9f-a6fc-4254-b4ac-
    > c85aad71156f"/>
    > </head>
    > <body style="margin-top: 0px; margin-left: 0px; margin-right: 0px;
    > margin-bottom: 0px; text-align: center; background-color: #FFFFFF;">
    > <div class="centerImage1"><svg:svg height="100%" viewBox="0 0 1200
    > 1600" width="100%"><svg:image height="1600" transform="translate(0 0)"
    > width="1200" xlink:href="Images/cover.jpg"/></svg:svg></div>
    > </body>
    > </html>
    >
    > As you can see, it uses some schema that knows what an svg:image is,
    > and the result is to display an image this way without the img tag.


    That document uses namespaces, not schemas.

    > In firefox, if I give this file the extension xhtml, it displays
    > fine. But IE doesn't like rendering xhtml.


    Which IE version are you talking about? IE 9 is out as a release
    candidate and it has support for rendering XHTML and SVG natively.
    Earlier versions of IE do not support rendering SVG natively, you need
    to use a plugin.


    --

    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Feb 25, 2011
    #2
    1. Advertising

  3. Andy

    Andy Guest

    > > As you can see, it uses some schema that knows what an svg:image is,
    > > and the result is to display an image this way without the img tag.

    >
    > That document uses namespaces, not schemas.
    >
    > > In firefox, if I give this file the extension xhtml, it displays
    > > fine.  But IE doesn't like rendering xhtml.

    >
    > Which IE version are you talking about? IE 9 is out as a release
    > candidate and it has support for rendering XHTML and SVG natively.
    > Earlier versions of IE do not support rendering SVG natively, you need
    > to use a plugin.
    >


    I am using IE 7 and IE 8 in testing. I'll try IE 9 soon. Thanks. But
    why is IE 7 and 8 able to display this document somewhat correctly,
    including the svg:image tag, if I use the described hack to get IE to
    render the document as application/xml? In particular, how does it
    know what to do with the svg:image tag? Also, in the iexhtmlfix.xsl
    stylesheet being used for IE, I am telling it to output as xml, not
    html. Why?
     
    Andy, Feb 25, 2011
    #3
  4. Andy wrote:
    >>> As you can see, it uses some schema that knows what an svg:image is,
    >>> and the result is to display an image this way without the img tag.

    >>
    >> That document uses namespaces, not schemas.
    >>
    >>> In firefox, if I give this file the extension xhtml, it displays
    >>> fine. But IE doesn't like rendering xhtml.

    >>
    >> Which IE version are you talking about? IE 9 is out as a release
    >> candidate and it has support for rendering XHTML and SVG natively.
    >> Earlier versions of IE do not support rendering SVG natively, you need
    >> to use a plugin.
    >>

    >
    > I am using IE 7 and IE 8 in testing. I'll try IE 9 soon. Thanks. But
    > why is IE 7 and 8 able to display this document somewhat correctly,
    > including the svg:image tag, if I use the described hack to get IE to
    > render the document as application/xml? In particular, how does it
    > know what to do with the svg:image tag? Also, in the iexhtmlfix.xsl
    > stylesheet being used for IE, I am telling it to output as xml, not
    > html. Why?


    Can you post a URL we can visit to see that IE 8 renders SVG?


    --

    Martin Honnen
    http://msmvps.com/blogs/martin_honnen/
     
    Martin Honnen, Feb 25, 2011
    #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. Matthew Louden
    Replies:
    1
    Views:
    7,021
    Scott M.
    Oct 11, 2003
  2. Russ

    script versus code versus ?

    Russ, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,524
  3. cvissy
    Replies:
    0
    Views:
    624
    cvissy
    Nov 16, 2004
  4. Christoffer Sawicki
    Replies:
    5
    Views:
    275
    Christoffer Sawicki
    Sep 2, 2006
  5. Paul Butcher
    Replies:
    12
    Views:
    756
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page