Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > xalan versus ie xml rendering

Reply
Thread Tools

xalan versus ie xml rendering

 
 
Andy
Guest
Posts: n/a
 
      02-25-2011
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" xmlnsps="http://www.idpf.org/
2007/ops" xmlns:svg="http://www.w3.org/2000/svg" xmlnslink="http://
www.w3.org/1999/xlink" xmlnssi="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 xmlnssl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xslutput 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
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      02-25-2011
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" xmlnsps="http://www.idpf.org/
> 2007/ops" xmlns:svg="http://www.w3.org/2000/svg" xmlnslink="http://
> www.w3.org/1999/xlink" xmlnssi="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/
 
Reply With Quote
 
 
 
 
Andy
Guest
Posts: n/a
 
      02-25-2011
> > 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?

 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      02-25-2011
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Mozilla versus IE versus Opera versus Safari Peter Potamus the Purple Hippo Firefox 0 05-08-2008 12:56 PM
equal? versus eql? versus == versus === verus <=> Paul Butcher Ruby 12 11-28-2007 06:06 AM
IE6 SP1 rendering vs IE6 SP2 rendering Peter Mount HTML 4 01-31-2006 08:01 AM
ERRor using jboss 4.0 and xercers, xalan ,xslt, to get xml satish mn via JavaKB.com Java 0 11-25-2004 03:14 PM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM



Advertisments