ie xhtml rendering with script code

A

Andy

Hi,

I found on the internet a way to fool IE into rendering a true xhtml
page, which it will not normally do. You take the <?xml header of the
xhtml file and amend it to reference this stylesheet: on your server:

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

and send the amended xhtml file with mime application/xml instead of
text/html. Then, even if the xhtml file has references to schemas
elsewhere and xml tags that use those schemas and make no sense as
html, the IE browser will display the document.

The reason this relates to this forum, is that I want to manipulate
dom elements of the iframe that holds this ie rendered xhtml file, and
change set the class of the span element dynamically to a class with a
style that is referenced (by dynamic insertion) in the xhtml file.

When I serve the document to IE as xml, I am able to get DOM elements,
but the changing of the class of the span is ignored. Whereas,
serving as a mime xhtml to a firefox browser, I am successfully able
to dynamically change the class of span elements in the iframe.

Basically, I want to both get IE to render xhtml, and be able to get
IE to recognize changes to the DOM element's style.

Thanks,
Andy
 
M

Michael Haufe (\TNO\)

Hi,

I found on the internet a way to fool IE into rendering a true xhtml
page, which it will not normally do.  You take the <?xml header of the
xhtml file and amend it to reference this stylesheet: on your server:

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

and send the amended xhtml file with mime application/xml instead of
text/html.  Then, even if the xhtml file has references to schemas
elsewhere and xml tags that use those schemas and make no sense as
html, the IE browser will display the document.

I'm curious to what document.documentMode returns for you.
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top