xalan versus ie xml rendering

A

Andy

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
 
M

Martin Honnen

Andy said:
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.
 
A

Andy

As you can see, it uses some schema that knows what an svg:image is,
That document uses namespaces, not schemas.


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?
 
M

Martin Honnen

Andy said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top