Hello,
Below is a modified version of the example here: msdn.microsoft.com/en-us/library/ms757058(v=vs.85).aspx.
It demonstrates functionality that is very similar to a legacy site I am currently supporting.
The difference is that in my example, I am not using data islands. Instead I am using a Processing Instructions to transform the initial xml document and then I am attempting to use Javascript to transform the document again after the initial render.
The problem is that in IE9 Standards mode there doesn't appear to be any access to the initial xml or xsl document from Javascript, after the content has been transformed to HTML.
This example will however work in Compatibility View where I can still access document.XMLDocument and document.XSLDocument.
Q1. In IE9 Standards Mode, is there any way to access the XML/XSL documents that produce a HTML page after it is rendered?
Q2. Can anyone confirm that support for document.XMLDocument and document.XSLDocument went away with support for XML Data Islands in IE9?
Thanks in advance
book_catalog.xml
<?xml version="1.0"?><?xml-stylesheet href="book_catalog.xsl" type="text/xsl"?><catalog><book id="bk101"><title>XML Developer's Guide</title><author>Gambardella, Matthew</author><genre>Computer</genre><price>44.95</price><publish_date>2000-10-01</publish_date> <description>An in-depth look at creating applications with XML.</description></book><book id="bk102"><title>Midnight Rain</title><author>Ralls, Kim</author><genre>Fantasy</genre><price>5.95</price><publish_date>2000-12-16</publish_date><description>A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.</description></book><book id="bk103"><title>Maeve Ascendant</title><author>Corets, Eva</author><genre>Fantasy</genre><price>5.95</price><publish_date>2000-11-17</publish_date><description>After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.</description></book><book id="bk104"><title>Oberon's Legacy</title><author>Corets, Eva</author><genre>Fantasy</genre><price>5.95</price><publish_date>2001-03-10</publish_date><description>In post-apocalypse England, the mysterious agent known only as Oberon helps to create a new life for the inhabitants of London. Sequel to Maeve Ascendant.</description></book><book id="bk105"><title>The Sundered Grail</title><author>Corets, Eva</author><genre>Fantasy</genre><price>5.95</price><publish_date>2001-09-10</publish_date><description>The two daughters of Maeve, half-sisters, battle one another for control of England. Sequel to Oberon's Legacy.</description></book><book id="bk106"><title>Lover Birds</title><author>Randall, Cynthia</author><genre>Romance</genre><price>4.95</price><publish_date>2000-09-02</publish_date><description>When Carla meets Paul at an ornithology conference, tempers fly as feathers get ruffled.</description></book><book id="bk107"><title>Splish Splash</title><author>Thurman, Paula</author><genre>Romance</genre><price>4.95</price><publish_date>2000-11-02</publish_date><description>A deep sea diver finds true love twenty thousand leagues beneath the sea.</description></book><book id="bk108"><title>Creepy Crawlies</title><author>Knorr, Stefan</author> <genre>Horror</genre><price>4.95</price><publish_date>2000-12-06</publish_date><description>An anthology of horror stories about roaches, centipedes, scorpions and other insects.</description></book><book id="bk109"><title>Paradox Lost</title><author>Kress, Peter</author><genre>Science Fiction</genre><price>6.95</price><publish_date>2000-11-02</publish_date><description>After an inadvertant trip through a Heisenberg Uncertainty Device, James Salway discovers the problems of being quantum.</description></book><book id="bk110"><title>Microsoft .NET: The Programming Bible</title><author>O'Brien, Tim</author><genre>Computer</genre><price>36.95</price><publish_date>2000-12-09</publish_date><description>Microsoft's .NET initiative is explored in detail in this deep programmer's reference.</description></book><book id="bk111"><title>MSXML3: A Comprehensive Guide</title><author>O'Brien, Tim</author><genre>Computer</genre><price>36.95</price><publish_date>2000-12-01</publish_date><description>The Microsoft MSXML3 parser is covered in detail, with attention to XML DOM interfaces, XSLT processing, SAX and more.</description></book><book id="bk112"><title>Visual Studio 7: A Comprehensive Guide</title><author>Galos, Mike</author><genre>Computer</genre><price>49.95</price><publish_date>2001-04-16</publish_date><description>Microsoft Visual Studio 7 is explored in depth, looking at how Visual Basic, Visual C++, C#, and ASP+ are integrated into a comprehensive development environment.</description></book> </catalog>book_catalog.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="1.0"><xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/><xsl:param name="selected_genre" select="'all'"/><xsl:template match="/"><HTML><HEAD><TITLE>Transform Demo</TITLE><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /><STYLE> .catalog_genre_head {background-color:darkGreen;font-size:24pt;color:white;font-family:Impact;} .catalog_head {background-color:green;font-size:18pt;color:white;font-family:Impact;} .catalog_row0 {background-color:lightGreen;} .catalog_row1 {background-color:white;} .catalog_row_end {background-color:darkGreen;}</STYLE><SCRIPT language="Javascript"> var processorCache=null; function loadSource(sourceObj){ var xmlDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0"); xmlDoc.async=false; xmlDoc.loadXML(sourceObj.xml); return xmlDoc; } function getProcessor(transformObj){ if (processorCache==null){ var xslDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.6.0"); var xslTemplate=new ActiveXObject("Msxml2.XSLTemplate.6.0"); xslDoc.async=false; xslDoc.loadXML(transformObj.xml); xslTemplate.stylesheet = xslDoc; xslProcessor=xslTemplate.createProcessor(); processorCache=xslProcessor; } else { xslProcessor=processorCache; } return xslProcessor; } function transformData(srcDoc,processor){ processor.input=srcDoc; processor.transform(); return processor.output; } function showGenre(genre){ var srcDoc=loadSource(document.XMLDocument); var processor=getProcessor(document.XSLDocument); processor.addParameter("selected_genre",genre); var txt=transformData(srcDoc,processor); document.body.innerHTML = txt; }</SCRIPT></HEAD><BODY><H1>Scootney Press Book Catalog</H1><P>Select a genre to see all books in that genre:</P><div><form method="post" action="#"> Genre:<select name="genre" value="{$selected_genre}" onchange="showGenre(this.value)"><option value="all"><xsl:if test="$selected_genre='all'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>All</option><option value="Computer"><xsl:if test="$selected_genre='Computer'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Computer</option><option value="Fantasy"><xsl:if test="$selected_genre='Fantasy'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Fantasy</option><option value="Horror"><xsl:if test="$selected_genre='Horror'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Horror</option><option value="Romance"><xsl:if test="$selected_genre='Romance'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Romance</option><option value="Science Fiction"><xsl:if test="$selected_genre='Science Fiction'"><xsl:attribute name="selected">Selected</xsl:attribute></xsl:if>Science Fiction</option></select></form><br/><xsl:apply-templates select="catalog"/></div></BODY></HTML> </xsl:template><xsl:template match="catalog"><table class="catalog_table"><xsl:apply-templates select="book[($selected_genre='all') or ($selected_genre=./genre)]"><xsl:sort select="title"/></xsl:apply-templates></table></xsl:template><xsl:template match="book"><xsl:if test="position()=1"><tr class="catalog_genre_head"><td colspan="6"><xsl:choose><xsl:when test="$selected_genre='all'"> All Genres</xsl:when><xsl:otherwise> Genre: <xsl:value-of select="genre"/></xsl:otherwise></xsl:choose></td></tr> <tr class="catalog_head"><td>#</td><td>Title</td><td>Author</td><td>Publication Date</td><td>Description</td><xsl:if test="$selected_genre='all'"><td>Genre</td></xsl:if></tr></xsl:if><tr class="catalog_row{position() mod 2}"><td><xsl:value-of select="position()"/></td><td class="catalog_cell"><xsl:value-of select="title"/></td><td class="catalog_cell"><xsl:value-of select="author"/></td><td class="catalog_cell"><xsl:value-of select="publish_date"/></td> <td class="catalog_cell"><xsl:value-of select="description"/></td><xsl:if test="$selected_genre='all'"><td class="catalog_cell"><xsl:value-of select="genre"/></td></xsl:if></tr><xsl:if test="position()=last()"><tr class="catalog_row_end"><td colspan="6"> </td></tr></xsl:if></xsl:template></xsl:stylesheet>